添加全局应用状态管理!

This commit is contained in:
CrescentLeaf
2025-12-27 23:04:11 +08:00
parent 12039612ca
commit 44168b4704
6 changed files with 396 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { Chat, User } from 'lingchair-client-protocol'
import { Dialog } from 'mdui'
import * as React from 'react'
type AppState = {
openChatInfo: (chat: Chat | string) => void,
openUserInfo: (user: Chat | User | string) => void,
openEditMyProfile: () => void,
openAddFavouriteChat: () => void,
openChat: (chat: string | Chat) => void,
closeChat: () => void,
}
const AppStateContext = React.createContext<AppState>({
openChatInfo: () => {},
openUserInfo: () => {},
openEditMyProfile: () => {},
openAddFavouriteChat: () => {},
openChat: () => {},
closeChat: () => {},
})
export type { AppState }
export default AppStateContext