+
-
-
ALL BOARDS ({board.length})
-
- {board && (
- <>
- {board.map((options: IBoard) => {
- return (
-
- );
- })}
- >
- )}
+ >
+
+
ALL BOARDS ({board.length})
+
+ {board && (
+ <>
+ {board.map((options: IBoard) => {
+ return (
+
+ );
+ })}
+ >
+ )}
+
+ {profile.id.length ? (
+
+ ) : null}
+
+
- {profile.id.length ? (
+
- ) : null}
+
-
-
-
-
-
-
+
setIsOpen(false)}>
setIsOpen(false)} />
diff --git a/src/page/dashboard/index.tsx b/src/page/dashboard/index.tsx
index 4f40d5a..12aa78d 100644
--- a/src/page/dashboard/index.tsx
+++ b/src/page/dashboard/index.tsx
@@ -1,6 +1,6 @@
import { useState, useEffect } from "react";
import Header from "components/Header";
-import { Collapse } from "@chakra-ui/react";
+
import { MdVisibilityOff } from "react-icons/md";
import SideBar from "components/SideBar";
import Board from "components/Board";
@@ -15,40 +15,35 @@ export default function Index() {
const data: AppState = useSelector(appData);
const { profile, board } = data;
const navigate = useNavigate();
+ const isMobile = useMediaQuery({ query: "(min-width: 700px)" });
useEffect(() => {
if (!profile.id.length) {
navigate("/workspace");
}
- }, [navigate, profile.id.length]);
+ if (isMobile === false && board.length < 1) {
+ console.log("see");
+ setShowSidebar(false);
+ }
+ }, [board.length, isMobile, navigate, profile.id.length]);
- const isMobile = useMediaQuery({ query: "(min-width: 700px)" });
return (
-
+
-
+
{profile.id.length ? (
-
+
) : null}
-
-
-
+
diff --git a/src/utilis/index.ts b/src/utilis/index.ts
index 3779eb6..c66d3f8 100644
--- a/src/utilis/index.ts
+++ b/src/utilis/index.ts
@@ -9,7 +9,7 @@ export const loadState = () => {
};
try {
- const serializedState = localStorage.getItem("boarddata");
+ const serializedState = localStorage.getItem("kanban");
if (serializedState === null) {
return initialState;
}
@@ -22,7 +22,7 @@ export const loadState = () => {
export const saveState = (state: any) => {
try {
const serializesState = JSON.stringify(state);
- localStorage.setItem("boarddata", serializesState);
+ localStorage.setItem("kanban", serializesState);
} catch (err) {
return err;
}