diff --git a/Client/src/Components/Sidebar/index.jsx b/Client/src/Components/Sidebar/index.jsx index 03a3b695c..0d420e762 100644 --- a/Client/src/Components/Sidebar/index.jsx +++ b/Client/src/Components/Sidebar/index.jsx @@ -44,6 +44,7 @@ import ChangeLog from "../../assets/icons/changeLog.svg?react"; import Docs from "../../assets/icons/docs.svg?react"; import Folder from "../../assets/icons/folder.svg?react"; import ChatBubbleOutlineRoundedIcon from "@mui/icons-material/ChatBubbleOutlineRounded"; +import CloseIcon from "@mui/icons-material/Close"; // Importing CloseIcon from MUI import "./index.css"; @@ -119,6 +120,7 @@ function Sidebar() { const [anchorEl, setAnchorEl] = useState(null); const [popup, setPopup] = useState(); const { user } = useSelector((state) => state.auth); + const [showStarRepo, setShowStarRepo] = useState(true); const accountMenuItem = menu.find((item) => item.name === "Account"); if (user.role?.includes("demo") && accountMenuItem) { @@ -156,6 +158,18 @@ function Sidebar() { } }, [location]); + useEffect(() => { + const hasClosed = localStorage.getItem("starRepoClosed"); + if (hasClosed) { + setShowStarRepo(false); + } + }, []); + + const handleCloseStarRepo = () => { + setShowStarRepo(false); + localStorage.setItem("starRepoClosed", "true"); + }; + /* TODO refactor this, there are a some ternaries and comments in the return */ return ( @@ -508,6 +522,69 @@ function Sidebar() { + {showStarRepo && ( + + + Star Checkmate + + + See the latest releases and help grow the community on GitHub + + + + Checkmate Logo + + + + + + + + )} +