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/forms/PostDropdownBtn.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/forms/PostDropdownBtn.tsx')
-rw-r--r-- | src/view/com/util/forms/PostDropdownBtn.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx index 1fffa3123..45abed647 100644 --- a/src/view/com/util/forms/PostDropdownBtn.tsx +++ b/src/view/com/util/forms/PostDropdownBtn.tsx @@ -2,7 +2,6 @@ import React from 'react' import {StyleProp, View, ViewStyle} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {toShareUrl} from 'lib/strings/url-helpers' -import {useStores} from 'state/index' import {useTheme} from 'lib/ThemeContext' import {shareUrl} from 'lib/sharing' import { @@ -10,6 +9,7 @@ import { DropdownItem as NativeDropdownItem, } from './NativeDropdown' import {EventStopper} from '../EventStopper' +import {useModalControls} from '#/state/modals' export function PostDropdownBtn({ testID, @@ -37,9 +37,9 @@ export function PostDropdownBtn({ onDeletePost: () => void style?: StyleProp<ViewStyle> }) { - const store = useStores() const theme = useTheme() const defaultCtrlColor = theme.palette.default.postCtrl + const {openModal} = useModalControls() const dropdownItems: NativeDropdownItem[] = [ { @@ -108,7 +108,7 @@ export function PostDropdownBtn({ !isAuthor && { label: 'Report post', onPress() { - store.shell.openModal({ + openModal({ name: 'report', uri: itemUri, cid: itemCid, @@ -129,7 +129,7 @@ export function PostDropdownBtn({ isAuthor && { label: 'Delete post', onPress() { - store.shell.openModal({ + openModal({ name: 'confirm', title: 'Delete this post?', message: 'Are you sure? This can not be undone.', |