-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add store.ts Add _redirects Add app.slice.ts Update index.tsx Update README.md Update package.json Update App.context.tsx Update package-lock.json
- Loading branch information
1 parent
bf08886
commit 2d81a64
Showing
11 changed files
with
146 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* /index.html 200 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { PayloadAction, createSlice } from "@reduxjs/toolkit"; | ||
|
||
interface IAppState { | ||
theme: "light" | "dark"; | ||
} | ||
const initialState: IAppState = { | ||
theme: "dark", | ||
}; | ||
|
||
export const appSlice = createSlice({ | ||
name: "app", | ||
initialState, | ||
reducers: { | ||
changeTheme(state) { | ||
state.theme = state.theme === "light" ? "dark" : "light"; | ||
}, | ||
}, | ||
}); | ||
export const { changeTheme } = appSlice.actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { configureStore } from "@reduxjs/toolkit"; | ||
import { appSlice } from "./app.slice"; | ||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"; | ||
|
||
export const store = configureStore({ | ||
reducer: { | ||
app: appSlice.reducer, | ||
}, | ||
}); | ||
export const useAppDispatch: () => typeof store.dispatch = useDispatch; | ||
export const useAppSelector: TypedUseSelectorHook< | ||
ReturnType<typeof store.getState> | ||
> = useSelector; |