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
This commit is contained in:
parent
5eadadffbf
commit
f18b15241a
70 changed files with 634 additions and 498 deletions
|
@ -1,9 +1,9 @@
|
|||
import React from 'react'
|
||||
import {Pressable, StyleProp, ViewStyle} from 'react-native'
|
||||
import {useStores} from 'state/index'
|
||||
import {Link} from './Link'
|
||||
import {isWeb} from 'platform/detection'
|
||||
import {makeProfileLink} from 'lib/routes/links'
|
||||
import {useModalControls} from '#/state/modals'
|
||||
|
||||
interface UserPreviewLinkProps {
|
||||
did: string
|
||||
|
@ -13,7 +13,7 @@ interface UserPreviewLinkProps {
|
|||
export function UserPreviewLink(
|
||||
props: React.PropsWithChildren<UserPreviewLinkProps>,
|
||||
) {
|
||||
const store = useStores()
|
||||
const {openModal} = useModalControls()
|
||||
|
||||
if (isWeb) {
|
||||
return (
|
||||
|
@ -29,7 +29,7 @@ export function UserPreviewLink(
|
|||
return (
|
||||
<Pressable
|
||||
onPress={() =>
|
||||
store.shell.openModal({
|
||||
openModal({
|
||||
name: 'profile-preview',
|
||||
did: props.did,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue