Skip to content

Commit

Permalink
fixed ui store, remove unused properties from web3 store
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Dec 21, 2023
1 parent 515406a commit 8964c69
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
31 changes: 19 additions & 12 deletions src/store/modules/ui.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ interface UiStore {
themeMode?: ThemeMode
}

export const [uiStore, useUiState] = createStore('ui', {} as UiStore, state => ({
setViewportWidth: (width: number) => {
state.viewportWidth = width
},
setThemeMode: (mode: ThemeMode) => {
state.themeMode = mode
},
clearUiStorage: () => {
state.themeMode = '' as ThemeMode
state.viewportWidth = 0
},
}))
export const [uiStore, useUiState] = createStore(
'ui',
{
viewportWidth: 0,
themeMode: ThemeMode.Light,
} as UiStore,
state => ({
setViewportWidth: (width: number) => {
state.viewportWidth = width
},
setThemeMode: (mode: ThemeMode) => {
state.themeMode = mode
},
clearUiStorage: () => {
state.themeMode = '' as ThemeMode
state.viewportWidth = 0
},
}),
)
5 changes: 0 additions & 5 deletions src/store/modules/web3.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ import { SUPPORTED_PROVIDERS } from '@/types'

interface Web3State {
providerType?: SUPPORTED_PROVIDERS
kek: string
}

const [web3Store, useWeb3State] = createStore(
'web3',
{
providerType: undefined,
kek: 'kek',
} as Web3State,
state => ({
setProviderType: (providerType: SUPPORTED_PROVIDERS | undefined) => {
state.providerType = providerType
},
setKek: (kek: string) => {
state.kek = kek
},
}),
)

Expand Down

0 comments on commit 8964c69

Please sign in to comment.