From 416af5d556feeb5df9c19c2197f2ef55b5fd1968 Mon Sep 17 00:00:00 2001 From: yash Date: Sat, 17 Feb 2024 00:34:02 +0530 Subject: [PATCH] rfac: workspace-view --- src/app/components/timeRangeSwitch/index.tsx | 2 +- src/app/index.scss | 5 +++++ src/features/workspace-view/index.tsx | 2 ++ .../workspace-view/workspace-card/index.tsx | 15 ++++++++------- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/components/timeRangeSwitch/index.tsx b/src/app/components/timeRangeSwitch/index.tsx index f3b571f..f5f55db 100644 --- a/src/app/components/timeRangeSwitch/index.tsx +++ b/src/app/components/timeRangeSwitch/index.tsx @@ -14,7 +14,7 @@ const TimeRangeSwitch: React.FC = ({ weekly, setWeekly }) => { // const dispatch = useDispatch(); // const isWeekly = useSelector((state: timeRangeModel) => state.isWeekly.value); useEffect(()=>{ - console.log(weekly,"makki") + },[weekly, setWeekly]) return (
diff --git a/src/app/index.scss b/src/app/index.scss index 058bdb6..f49efde 100644 --- a/src/app/index.scss +++ b/src/app/index.scss @@ -37,3 +37,8 @@ a:hover { .bd-white { border: 1px solid white; } + + +.pointer{ + cursor: pointer; +} \ No newline at end of file diff --git a/src/features/workspace-view/index.tsx b/src/features/workspace-view/index.tsx index 26d3f08..cf720d5 100644 --- a/src/features/workspace-view/index.tsx +++ b/src/features/workspace-view/index.tsx @@ -15,6 +15,7 @@ const WorkspaceView = () => { const [isLoad, setIsLoad] = useState(false); const [archeives, setArcheives] = useState(false); const token = localStorage.getItem('token'); + const [orgs, setOrgs] = useState(); const navigate = useNavigate(); const fetchData = async () => { if (token && userContext?.username) { @@ -25,6 +26,7 @@ const WorkspaceView = () => { userContext?.username.toString() ); userContext?.setUserOrgs(userOrgs.data); + } catch (e) {} setIsLoad(false); diff --git a/src/features/workspace-view/workspace-card/index.tsx b/src/features/workspace-view/workspace-card/index.tsx index 88a21ab..ad94b19 100644 --- a/src/features/workspace-view/workspace-card/index.tsx +++ b/src/features/workspace-view/workspace-card/index.tsx @@ -22,6 +22,7 @@ type workspaceCardProps = { bookmark: boolean; archeives: boolean; }; + interface members { [username: string]: string; } @@ -31,7 +32,6 @@ const WorkspaceCard = (props: workspaceCardProps) => { const [description, setDescription] = useState(null); const [showPopUp, setShowPopUp] = useState(false); const token = localStorage.getItem('token'); - const [fileName, setFileName] = useState(null); const [imageSrc, setImageSrc] = useState(null); const [members, setMembers] = useState(null); const [membersArray, setMembersArray]= useState<{username:string}[]>([]); @@ -167,7 +167,7 @@ const WorkspaceCard = (props: workspaceCardProps) => {
setShowPopUp(showPopUp ? false : true)} > {!workspaceName.endsWith('-userspace') && ( @@ -178,16 +178,16 @@ const WorkspaceCard = (props: workspaceCardProps) => { )}
-
+
{bookmark ? 'UnPin' : 'Pin'}
-
+
{archeive ? 'Unarchive' : 'archive'}
{members && userContext?.username && members[userContext?.username.toString()] === 'admin' && ( -
+
delete
)} @@ -195,7 +195,7 @@ const WorkspaceCard = (props: workspaceCardProps) => { userContext?.username && members[userContext?.username.toString()] === 'admin' && (
navigate(`/editWorkspace/${workspaceName}`)} > edit @@ -219,7 +219,7 @@ const WorkspaceCard = (props: workspaceCardProps) => { ? "USER's WORKSPACE" : workspaceName}
-
navigate(`/workspaceMembers/${workspaceName}`)}> +
navigate(`/workspaceMembers/${workspaceName}`)}>
{ membersArray.length > 0 ? ( @@ -258,6 +258,7 @@ const WorkspaceCard = (props: workspaceCardProps) => {
navigate(`/workspace/${workspaceName}`)} alt='' />