From e714711a390e57fa94f309be03783f7bc3a6b54b Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 22 Oct 2024 17:24:16 -0500 Subject: [PATCH] Bippin and boppin --- src/Navigation.tsx | 3 +- src/components/Layout.tsx | 175 +++++++++++++++++++++++++++- src/screens/Feeds/Creator/index.tsx | 101 ++++++++++++++++ web/index.html | 2 +- 4 files changed, 277 insertions(+), 4 deletions(-) create mode 100644 src/screens/Feeds/Creator/index.tsx diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 44b7830640..bf80f3c9ef 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -76,6 +76,7 @@ import {TermsOfServiceScreen} from '#/view/screens/TermsOfService' import {BottomBar} from '#/view/shell/bottom-bar/BottomBar' import {createNativeStackNavigatorWithAuth} from '#/view/shell/createNativeStackNavigatorWithAuth' import {SharedPreferencesTesterScreen} from '#/screens/E2E/SharedPreferencesTesterScreen' +import {Creator as FeedCreator} from '#/screens/Feeds/Creator' import {Wizard as FeedsWizard} from '#/screens/Feeds/Wizard' import HashtagScreen from '#/screens/Hashtag' import {MessagesScreen} from '#/screens/Messages/ChatList' @@ -354,7 +355,7 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) { /> FeedsWizard} + getComponent={() => FeedCreator} options={{title: title(msg`Create a feed`), requireAuth: true}} /> , +) { + return ( + + {children} + + ) +}) + +export const Center = React.forwardRef(function LayoutContent( + {children, style, ...props}: ViewProps & {children: React.ReactNode}, + ref: React.Ref, +) { + const t = useTheme() + const {gtMobile} = useBreakpoints() + return ( + <> + {gtMobile && ( + + )} + + {children} + + + ) +}) + +export function Gutter({ + children, + top, + bottom, +}: { + children: React.ReactNode + top?: boolean + bottom?: boolean +}) { + const {gtMobile} = useBreakpoints() + return ( + + {children} + + ) +} + +export function Header({children}: {children: React.ReactNode}) { + const {_} = useLingui() + const {gtMobile} = useBreakpoints() + const navigation = useNavigation() + + const onPressBack = React.useCallback(() => { + if (navigation.canGoBack()) { + navigation.goBack() + } else { + navigation.navigate('Home') + } + }, [navigation]) + + return ( + + + + + {children} + + + + + + + + ) +} + +Header.TitleText = function HeaderTitleText({ + children, +}: { + children: React.ReactNode +}) { + const {gtMobile} = useBreakpoints() + return ( + + {children} + + ) +} diff --git a/src/screens/Feeds/Creator/index.tsx b/src/screens/Feeds/Creator/index.tsx new file mode 100644 index 0000000000..c8ab3018ce --- /dev/null +++ b/src/screens/Feeds/Creator/index.tsx @@ -0,0 +1,101 @@ +import React from 'react' +import {View} from 'react-native' +import {msg, Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {useProfileQuery} from '#/state/queries/profile' +import {useSession} from '#/state/session' +import {atoms as a, useTheme} from '#/alf' +import {Admonition} from '#/components/Admonition' +import * as TextField from '#/components/forms/TextField' +import * as Layout from '#/components/Layout' +import {Text} from '#/components/Typography' + +export function Creator() { + const t = useTheme() + const {_} = useLingui() + const {currentAccount} = useSession() + const {data: currentProfile} = useProfileQuery({ + did: currentAccount?.did, + staleTime: 300, + }) + + const [name, setName] = React.useState('') + const [description, setDescription] = React.useState('') + + return ( + + + + + Create a feed + + + + + + + Create a feed for you, your friends, or your organization. You + can decide what type of content is included using the options + below. + + + + + + Title + + + + + + + {name?.length ?? 0}/50 + + + + + + + Description + + + + + + + + Choosing a descriptive title and description will help others + find your feed! + + + + + + + ) +} diff --git a/web/index.html b/web/index.html index 7b29597bb7..1a3d82e96c 100644 --- a/web/index.html +++ b/web/index.html @@ -45,7 +45,7 @@ } html { background-color: white; - scrollbar-gutter: stable both-edges; + /*scrollbar-gutter: stable both-edges;*/ } @media (prefers-color-scheme: dark) { html {