Skip to content

Commit

Permalink
feat(store): add background store
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Sep 2, 2022
1 parent 25c13b0 commit d18d303
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/stores/BackgroundStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import create from 'zustand'

type Background =
| 'animated'
| 'dark'
| 'lofi-rain'
| 'train-rain'
| 'tree'
| 'disabled'

interface BackgroundStore {
background: Background
setBackground: (newBackground: Background) => void
}

export const useBackgroundStore = create<BackgroundStore>(set => ({
background: 'disabled',
setBackground: newBackground => set(() => ({ background: newBackground }))
}))

0 comments on commit d18d303

Please sign in to comment.