From e6b63e3f53061a207587cfbd98095386a8e90167 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 26 Jan 2023 23:04:38 -0600 Subject: [PATCH] Update compose prompts for web --- .../{PromptButtons.tsx => ComposerPrompt.tsx} | 2 +- src/view/com/posts/ComposerPrompt.web.tsx | 41 +++++++++++++++++++ src/view/com/posts/Feed.tsx | 6 +-- src/view/com/util/FAB.web.tsx | 8 ++++ src/view/shell/web/left-column.tsx | 26 +++++++++++- 5 files changed, 77 insertions(+), 6 deletions(-) rename src/view/com/posts/{PromptButtons.tsx => ComposerPrompt.tsx} (97%) create mode 100644 src/view/com/posts/ComposerPrompt.web.tsx create mode 100644 src/view/com/util/FAB.web.tsx diff --git a/src/view/com/posts/PromptButtons.tsx b/src/view/com/posts/ComposerPrompt.tsx similarity index 97% rename from src/view/com/posts/PromptButtons.tsx rename to src/view/com/posts/ComposerPrompt.tsx index 2a8e5808..1ddc2875 100644 --- a/src/view/com/posts/PromptButtons.tsx +++ b/src/view/com/posts/ComposerPrompt.tsx @@ -3,7 +3,7 @@ import {StyleSheet, TouchableOpacity, View} from 'react-native' import {Text} from '../util/text/Text' import {usePalette} from '../../lib/hooks/usePalette' -export function PromptButtons({ +export function ComposerPrompt({ onPressCompose, }: { onPressCompose: (imagesOpen?: boolean) => void diff --git a/src/view/com/posts/ComposerPrompt.web.tsx b/src/view/com/posts/ComposerPrompt.web.tsx new file mode 100644 index 00000000..96c09f0b --- /dev/null +++ b/src/view/com/posts/ComposerPrompt.web.tsx @@ -0,0 +1,41 @@ +import React from 'react' +import {StyleSheet, TouchableWithoutFeedback, View} from 'react-native' +import {Text} from '../util/text/Text' +import {usePalette} from '../../lib/hooks/usePalette' +import {s} from '../../lib/styles' + +export function ComposerPrompt({ + onPressCompose, +}: { + onPressCompose: (imagesOpen?: boolean) => void +}) { + const pal = usePalette('default') + return ( + onPressCompose(false)}> + + + What's up? + + + + Post + + + + ) +} + +const styles = StyleSheet.create({ + container: { + paddingVertical: 16, + paddingHorizontal: 18, + flexDirection: 'row', + alignItems: 'center', + borderTopWidth: 1, + }, + btn: { + paddingVertical: 6, + paddingHorizontal: 14, + borderRadius: 30, + }, +}) diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index db05caa3..409ce4af 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -13,7 +13,7 @@ import {EmptyState} from '../util/EmptyState' import {ErrorMessage} from '../util/error/ErrorMessage' import {FeedModel} from '../../../state/models/feed-view' import {FeedItem} from './FeedItem' -import {PromptButtons} from './PromptButtons' +import {ComposerPrompt} from './ComposerPrompt' import {OnScrollCb} from '../../lib/hooks/useOnMainScroll' import {s} from '../../lib/styles' @@ -43,7 +43,7 @@ export const Feed = observer(function Feed({ // like PureComponent, shouldComponentUpdate, etc const renderItem = ({item}: {item: any}) => { if (item === COMPOSE_PROMPT_ITEM) { - return + return } else if (item === EMPTY_FEED_ITEM) { return ( - {!data && } + {!data && } {feed.isLoading && !data && } {feed.hasError && ( void) | undefined +export const FAB = (_opts: {icon: IconProp; onPress: OnPress}) => { + return +} diff --git a/src/view/shell/web/left-column.tsx b/src/view/shell/web/left-column.tsx index 5e3aba5b..44559b6a 100644 --- a/src/view/shell/web/left-column.tsx +++ b/src/view/shell/web/left-column.tsx @@ -1,10 +1,11 @@ import React from 'react' -import {Pressable, StyleSheet, View} from 'react-native' +import {Pressable, StyleSheet, TouchableOpacity, View} from 'react-native' import {observer} from 'mobx-react-lite' +import LinearGradient from 'react-native-linear-gradient' import {Link} from '../../com/util/Link' import {Text} from '../../com/util/text/Text' import {UserAvatar} from '../../com/util/UserAvatar' -import {colors} from '../../lib/styles' +import {s, colors, gradients} from '../../lib/styles' import {useStores} from '../../../state' import {usePalette} from '../../lib/hooks/usePalette' import { @@ -63,6 +64,7 @@ export const NavItem = observer( export const DesktopLeftColumn = observer(() => { const store = useStores() const pal = usePalette('default') + const onPressCompose = () => store.shell.openComposer({}) const avi = ( { icon={} iconFilled={} /> + + + + New Post + + + ) }) @@ -148,4 +161,13 @@ const styles = StyleSheet.create({ navItemLabel: { fontSize: 19, }, + composeBtn: { + marginTop: 20, + marginBottom: 10, + marginLeft: 10, + marginRight: 20, + borderRadius: 30, + paddingHorizontal: 20, + paddingVertical: 12, + }, })