ISSUE-005 - Emulating an iOS toggle switch and hooked it all up. Good practice.
Think there is some improvements I can make, though. The toggle circle on iOS has the drop shadow - not the body (with an inset shadow). But because I'm using absolute positioning the shadow overflows outside the the toggle body. So. I'll need to switch to using some other positioning rule
This commit is contained in:
1 parent
7c2654ba51
commit
3151c58d9d
14 files changed
+212
-14
No files matched your search
@@ -0,0 +1,3 @@
|
||||
import { RootState } from "../../types/state";
|
||||
|
||||
export const workspaceSelector = (state: RootState) => state.workspace;
|
||||
@@ -0,0 +1,23 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { RootState, WorkspaceId, AnimatedBG } from "../../types/state";
|
||||
|
||||
const initialState: RootState["workspace"] = {
|
||||
workspaceId: "",
|
||||
animatedBG: true,
|
||||
};
|
||||
|
||||
export const workspaceSlice = createSlice({
|
||||
name: "workspace",
|
||||
initialState,
|
||||
reducers: {
|
||||
setWorkspaceId: (state, action: PayloadAction<WorkspaceId>) => {
|
||||
state.workspaceId = action.payload;
|
||||
},
|
||||
setAnimatedBG: (state, action: PayloadAction<AnimatedBG>) => {
|
||||
state.animatedBG = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setWorkspaceId, setAnimatedBG } = workspaceSlice.actions;
|
||||
export default workspaceSlice.reducer;
|
||||
Reference in new issue
Block a user