Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 38 lines 1.2 kB view raw
1import {createContext, useContext, useMemo, useState} from 'react' 2 3import * as Dialog from '#/components/Dialog' 4import {type DialogControlProps} from '#/components/Dialog' 5import {VerifyEmailIntentDialog} from '#/components/intents/VerifyEmailIntentDialog' 6 7interface Context { 8 verifyEmailDialogControl: DialogControlProps 9 verifyEmailState: {code: string} | undefined 10 setVerifyEmailState: (state: {code: string} | undefined) => void 11} 12 13const Context = createContext({} as Context) 14Context.displayName = 'IntentDialogsContext' 15export const useIntentDialogs = () => useContext(Context) 16 17export function Provider({children}: {children: React.ReactNode}) { 18 const verifyEmailDialogControl = Dialog.useDialogControl() 19 const [verifyEmailState, setVerifyEmailState] = useState< 20 {code: string} | undefined 21 >() 22 23 const value = useMemo( 24 () => ({ 25 verifyEmailDialogControl, 26 verifyEmailState, 27 setVerifyEmailState, 28 }), 29 [verifyEmailDialogControl, verifyEmailState, setVerifyEmailState], 30 ) 31 32 return ( 33 <Context.Provider value={value}> 34 {children} 35 <VerifyEmailIntentDialog /> 36 </Context.Provider> 37 ) 38}