diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-11-14 10:41:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 10:41:55 -0800 |
commit | 0a26e78dcbbf48dad5daae73b210e236d706b22c (patch) | |
tree | c06c737ed49e8294bf5cbec1a75c36b591cb6669 /src/view/com/post | |
parent | c687172de96bd6aa85d3aa025c2e0f024640f345 (diff) | |
download | voidsky-0a26e78dcbbf48dad5daae73b210e236d706b22c.tar.zst |
Composer update (react-query refactor) (#1899)
* Move composer state to a context * Rework composer to use RQ --------- Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/view/com/post')
-rw-r--r-- | src/view/com/post/Post.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 4a5b8041e..09edbe12f 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -19,7 +19,6 @@ import {PostAlerts} from '../util/moderation/PostAlerts' import {Text} from '../util/text/Text' import {RichText} from '../util/text/RichText' import {PreviewableUserAvatar} from '../util/UserAvatar' -import {useStores} from 'state/index' import {s, colors} from 'lib/styles' import {usePalette} from 'lib/hooks/usePalette' import {makeProfileLink} from 'lib/routes/links' @@ -27,6 +26,7 @@ import {MAX_POST_LINES} from 'lib/constants' import {countLines} from 'lib/strings/helpers' import {useModerationOpts} from '#/state/queries/preferences' import {usePostShadow, POST_TOMBSTONE} from '#/state/cache/post-shadow' +import {useComposerControls} from '#/state/shell/composer' export function Post({ post, @@ -97,7 +97,7 @@ function PostInner({ style?: StyleProp<ViewStyle> }) { const pal = usePalette('default') - const store = useStores() + const {openComposer} = useComposerControls() const [limitLines, setLimitLines] = useState( countLines(richText?.text) >= MAX_POST_LINES, ) @@ -110,7 +110,7 @@ function PostInner({ } const onPressReply = React.useCallback(() => { - store.shell.openComposer({ + openComposer({ replyTo: { uri: post.uri, cid: post.cid, @@ -122,7 +122,7 @@ function PostInner({ }, }, }) - }, [store, post, record]) + }, [openComposer, post, record]) const onPressShowMore = React.useCallback(() => { setLimitLines(false) |