about summary refs log tree commit diff
path: root/src/view/com/modals/ServerInput.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-08 12:34:10 -0600
committerGitHub <noreply@github.com>2023-11-08 10:34:10 -0800
commitf18b15241ab708f8c25a11937a875e361e9f1221 (patch)
tree07829ce8617cb858b4519d6f16c89c7e43f84d9c /src/view/com/modals/ServerInput.tsx
parent5eadadffbf5475b233da7b1463e2345ff3e3cfce (diff)
downloadvoidsky-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/modals/ServerInput.tsx')
-rw-r--r--src/view/com/modals/ServerInput.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/view/com/modals/ServerInput.tsx b/src/view/com/modals/ServerInput.tsx
index 13b21fe22..0f8db30b6 100644
--- a/src/view/com/modals/ServerInput.tsx
+++ b/src/view/com/modals/ServerInput.tsx
@@ -6,26 +6,26 @@ import {
 } from '@fortawesome/react-native-fontawesome'
 import {ScrollView, TextInput} from './util'
 import {Text} from '../util/text/Text'
-import {useStores} from 'state/index'
 import {s, colors} from 'lib/styles'
 import {usePalette} from 'lib/hooks/usePalette'
 import {useTheme} from 'lib/ThemeContext'
 import {LOCAL_DEV_SERVICE, STAGING_SERVICE, PROD_SERVICE} from 'state/index'
 import {LOGIN_INCLUDE_DEV_SERVERS} from 'lib/build-flags'
+import {useModalControls} from '#/state/modals'
 
 export const snapPoints = ['80%']
 
 export function Component({onSelect}: {onSelect: (url: string) => void}) {
   const theme = useTheme()
   const pal = usePalette('default')
-  const store = useStores()
   const [customUrl, setCustomUrl] = useState<string>('')
+  const {closeModal} = useModalControls()
 
   const doSelect = (url: string) => {
     if (!url.startsWith('http://') && !url.startsWith('https://')) {
       url = `https://${url}`
     }
-    store.shell.closeModal()
+    closeModal()
     onSelect(url)
   }