diff options
author | Eric Bailey <git@esb.lol> | 2023-11-08 12:34:10 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-08 10:34:10 -0800 |
commit | f18b15241ab708f8c25a11937a875e361e9f1221 (patch) | |
tree | 07829ce8617cb858b4519d6f16c89c7e43f84d9c /src/view/com/util/post-ctrls/RepostButton.tsx | |
parent | 5eadadffbf5475b233da7b1463e2345ff3e3cfce (diff) | |
download | voidsky-f18b15241ab708f8c25a11937a875e361e9f1221.tar.zst |
Add modal state provider, replace usage except methods (#1833)
* Add modal state provider, replace usage except methods * Replace easy spots * Fix sticky spots * Replace final usages * Memorize context objects * Add more warnings
Diffstat (limited to 'src/view/com/util/post-ctrls/RepostButton.tsx')
-rw-r--r-- | src/view/com/util/post-ctrls/RepostButton.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/com/util/post-ctrls/RepostButton.tsx b/src/view/com/util/post-ctrls/RepostButton.tsx index 9c4ed8e5d..0a7637252 100644 --- a/src/view/com/util/post-ctrls/RepostButton.tsx +++ b/src/view/com/util/post-ctrls/RepostButton.tsx @@ -5,8 +5,8 @@ import {s, colors} from 'lib/styles' import {useTheme} from 'lib/ThemeContext' import {Text} from '../text/Text' import {pluralize} from 'lib/strings/helpers' -import {useStores} from 'state/index' import {HITSLOP_10, HITSLOP_20} from 'lib/constants' +import {useModalControls} from '#/state/modals' interface Props { isReposted: boolean @@ -23,8 +23,8 @@ export const RepostButton = ({ onRepost, onQuote, }: Props) => { - const store = useStores() const theme = useTheme() + const {openModal} = useModalControls() const defaultControlColor = React.useMemo( () => ({ @@ -34,13 +34,13 @@ export const RepostButton = ({ ) const onPressToggleRepostWrapper = useCallback(() => { - store.shell.openModal({ + openModal({ name: 'repost', onRepost: onRepost, onQuote: onQuote, isReposted, }) - }, [onRepost, onQuote, isReposted, store.shell]) + }, [onRepost, onQuote, isReposted, openModal]) return ( <TouchableOpacity |