From d2b817a180d4a79d1bdf35e423bdeb74419ec2e0 Mon Sep 17 00:00:00 2001 From: Shuhaib T U Date: Mon, 11 Mar 2024 03:15:02 +0530 Subject: [PATCH] style: improved responsiveness of user pages --- client/src/Services/communityService.js | 2 +- client/src/components/UserHome/UserHome.jsx | 6 +- .../ViewMarkModal/ViewMarkModal.jsx | 2 +- .../community/NewDiscussion/NewDiscussion.jsx | 2 +- .../pages/UserPages/Community/Community.jsx | 197 +++++++++--------- .../UserPages/Community/ViewCommunity.jsx | 6 +- .../pages/UserPages/MyBodyPage/MyBodyPage.jsx | 2 +- .../pages/UserPages/MyLawsPage/MyLawsPage.jsx | 2 +- .../pages/UserPages/MyMindPage/MyMindPage.jsx | 2 +- 9 files changed, 108 insertions(+), 113 deletions(-) diff --git a/client/src/Services/communityService.js b/client/src/Services/communityService.js index d38765d..1375f8e 100644 --- a/client/src/Services/communityService.js +++ b/client/src/Services/communityService.js @@ -13,7 +13,7 @@ export const getRecentDiscussions = async (page) => { export const getCommunity = async function (communityId) { try { - const response = await thaliaAPI.get(`/community/get-details/${communityId}`); + const response = await thaliaAPI.get(`/community/get_details/${communityId}`); return response; } catch (error) { return error diff --git a/client/src/components/UserHome/UserHome.jsx b/client/src/components/UserHome/UserHome.jsx index a586096..e73d7a0 100644 --- a/client/src/components/UserHome/UserHome.jsx +++ b/client/src/components/UserHome/UserHome.jsx @@ -32,15 +32,15 @@ export default function UserHome() { className="absolute opacity-10 top-0 hidden md:inline-block md:w-full z-10" alt="" /> -
+
-

+

Chat with Didi

setOpenModal(true)} - className="w-12 h-12 cursor-pointer rounded-full flex items-center justify-center bg-text" + className="w-14 h-14 cursor-pointer rounded-full flex items-center justify-center bg-text" >
diff --git a/client/src/components/ViewMarkModal/ViewMarkModal.jsx b/client/src/components/ViewMarkModal/ViewMarkModal.jsx index ff89638..0b36881 100644 --- a/client/src/components/ViewMarkModal/ViewMarkModal.jsx +++ b/client/src/components/ViewMarkModal/ViewMarkModal.jsx @@ -22,7 +22,7 @@ export default function ViewMarkModal({ > {content.name} - + {content.content} diff --git a/client/src/components/community/NewDiscussion/NewDiscussion.jsx b/client/src/components/community/NewDiscussion/NewDiscussion.jsx index 652b720..e8b5dc5 100644 --- a/client/src/components/community/NewDiscussion/NewDiscussion.jsx +++ b/client/src/components/community/NewDiscussion/NewDiscussion.jsx @@ -58,7 +58,7 @@ export default function NewDiscussion({ onClose={() => setOpenModal(false)} popup > - + {isLoading ? ( ) : ( diff --git a/client/src/pages/UserPages/Community/Community.jsx b/client/src/pages/UserPages/Community/Community.jsx index 72d2097..02946e4 100644 --- a/client/src/pages/UserPages/Community/Community.jsx +++ b/client/src/pages/UserPages/Community/Community.jsx @@ -11,114 +11,109 @@ import NewCommunity from "../../../components/community/NewCommunity"; import RecentDiscussions from "../../../components/community/RecentDiscussions/RecentDiscussions"; import YourCommunity from "../../../components/community/YourCommunity/YourCommunity"; import DiscoverCommunity from "../../../components/community/DiscoverCommunity/DiscoverCommunity"; +import LayersIcon from "@mui/icons-material/Layers"; export default function Community() { - const { tab } = useParams(); - const navigate = useNavigate(); - const [showSidebar, setShowSidebar] = useState("hidden"); - const [currentTab, setCurrentTab] = useState(tab.toUpperCase()); - const [showNewCommunity, setShowNewCommunity] = useState(false); - return ( -
- - {/*
- -

- Community -

-
*/} -
-

Community

- {/*
+ const { tab } = useParams(); + const navigate = useNavigate(); + const [showSidebar, setShowSidebar] = useState("hidden"); + const [currentTab, setCurrentTab] = useState(tab.toUpperCase()); + const [showNewCommunity, setShowNewCommunity] = useState(false); + return ( +
+ +
+ +

+ Community +

+
+
+

Community

+ {/*
*/} -
- setShowSidebar( - showSidebar === "block" ? "hidden" : "block" - ) - } - > -
{ - setCurrentTab("RECENT_DISCUSSIONS"); - navigate("/community/recent_discussions"); - }} - > -

Recent Discussions

-
-
{ - setCurrentTab("DISCOVER"); - navigate("/community/discover"); - }} - > -

Discover

-
-
{ - setCurrentTab("YOUR_COMMUNITY"); - navigate("/community/your_community"); - }} - > -

Your Community

-
-
-
- -
-
-
- {currentTab === "RECENT_DISCUSSIONS" ? ( - - ) : currentTab === "YOUR_COMMUNITY" ? ( - - ) : currentTab === "DISCOVER" ? ( - - ) : null} -
+
+ setShowSidebar(showSidebar === "block" ? "hidden" : "block") + } + > +
{ + setCurrentTab("RECENT_DISCUSSIONS"); + navigate("/community/recent_discussions"); + }} + > +

Recent Discussions

- ); +
{ + setCurrentTab("DISCOVER"); + navigate("/community/discover"); + }} + > +

Discover

+
+
{ + setCurrentTab("YOUR_COMMUNITY"); + navigate("/community/your_community"); + }} + > +

Your Community

+
+
+
+ +
+
+
+ {currentTab === "RECENT_DISCUSSIONS" ? ( + + ) : currentTab === "YOUR_COMMUNITY" ? ( + + ) : currentTab === "DISCOVER" ? ( + + ) : null} +
+
+ ); } diff --git a/client/src/pages/UserPages/Community/ViewCommunity.jsx b/client/src/pages/UserPages/Community/ViewCommunity.jsx index e63be66..6eebf52 100644 --- a/client/src/pages/UserPages/Community/ViewCommunity.jsx +++ b/client/src/pages/UserPages/Community/ViewCommunity.jsx @@ -132,7 +132,7 @@ export default function ViewCommunity() { myCommunity.map((item, index) => { return (
)}
-
+

{item.community_name}

@@ -177,7 +177,7 @@ export default function ViewCommunity() { className="h-14 w-14 rounded-md" /> ) : ( -

+

{currentCommunity?.community_name[0].toUpperCase()}

)} diff --git a/client/src/pages/UserPages/MyBodyPage/MyBodyPage.jsx b/client/src/pages/UserPages/MyBodyPage/MyBodyPage.jsx index 509cf5f..e98ed2b 100644 --- a/client/src/pages/UserPages/MyBodyPage/MyBodyPage.jsx +++ b/client/src/pages/UserPages/MyBodyPage/MyBodyPage.jsx @@ -85,7 +85,7 @@ export default function MyBodyPage() { {count > 0 && ( )} diff --git a/client/src/pages/UserPages/MyLawsPage/MyLawsPage.jsx b/client/src/pages/UserPages/MyLawsPage/MyLawsPage.jsx index 120f34a..ad09913 100644 --- a/client/src/pages/UserPages/MyLawsPage/MyLawsPage.jsx +++ b/client/src/pages/UserPages/MyLawsPage/MyLawsPage.jsx @@ -85,7 +85,7 @@ export default function MyLawsPage() { {count > 0 && ( )} diff --git a/client/src/pages/UserPages/MyMindPage/MyMindPage.jsx b/client/src/pages/UserPages/MyMindPage/MyMindPage.jsx index b671356..a94cd02 100644 --- a/client/src/pages/UserPages/MyMindPage/MyMindPage.jsx +++ b/client/src/pages/UserPages/MyMindPage/MyMindPage.jsx @@ -85,7 +85,7 @@ export default function MyMindPage() { {count > 0 && ( )}