Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into admin-client
Browse files Browse the repository at this point in the history
  • Loading branch information
amarnath-dev authored Mar 10, 2024
2 parents 7095e11 + c96a7f2 commit 9cd7787
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 51 deletions.
13 changes: 7 additions & 6 deletions client/src/components/AboutUs/AboutUs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ export default function AboutUs() {
What and why Thalia
</h2>
<p className="mb-10 text-text leading-relaxed text-body-color dark:text-dark-6">
Thalia is a website that hosts communities for women and
provides credible information on both physical and mental
health topics that are essential for every woman.
Additionally, there is a chatbot named Didi available for
sharing emotions and receiving advice.
<br />
<br />
Our vision is to empower women by providing personalized
guidance, reliable learning resources, and a supportive
community, all while prioritizing their safety and
trustworthiness.
<br />
<br />
We believe that women are like tea bags; their true strength
shines through when faced with challenges. We're here to
empower you. We firmly believe that when women support each
other, amazing things happen.
</p>

<Link
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/CheckReport/CheckReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function CheckReport({ openModal, setOpenModal, userReport }) {
<h2 id={`accordion-collapse-heading-${index}`}>
<button
type="button"
className="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-gray-500 border border-b-0 border-gray-200 rounded-t-xl dark:focus:ring-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 gap-3"
className="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-gray-500 border border-b-0 border-gray-600 rounded-t-xl dark:focus:ring-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 gap-3"
data-accordion-target={`#accordion-collapse-body-${index}`}
aria-expanded={accordionStates[index]}
aria-controls={`accordion-collapse-body-${index}`}
Expand Down Expand Up @@ -75,7 +75,7 @@ function CheckReport({ openModal, setOpenModal, userReport }) {
className={accordionStates[index] ? "block" : "hidden"}
aria-labelledby={`accordion-collapse-heading-${index}`}
>
<div className="p-5 border border-b-0 border-gray-200 dark:border-gray-700 dark:bg-gray-900">
<div className="p-5 border border-b-0 border-gray-600 dark:border-gray-700 dark:bg-gray-900">
<p className="mb-2 text-text dark:text-gray-400">
{report?.reason}
</p>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/CommunityCard/CommunityCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function CommunityCard() {
return (
<div
className="text-text flex flex-col items-center justify-center px-28 md:px-12 py-12 rounded-lg cursor-pointer hover:bg-secondary hover:text-primary bg-primary/[0.12]"
onClick={() => navigate("/community")}
onClick={() => navigate("/community/recent_discussions")}
>
<img src={Community} className="w-28" alt="" />
<h1 className="font-bold">Community</h1>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/EditBody/EditBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function EditBody({ setOpenModal, openModal, bodyDetails }) {
<Modal.Header className="bg-gray-800">
<h1 className="text-white font-bold">Edit Topic</h1>
</Modal.Header>
<Modal.Body className="ring-1 bg-background rounded-b-md px-2 py-2">
<Modal.Body className="ring-1 bg-gray-800 rounded-b-md px-2 py-2">
<div className="w-full">
<label htmlFor="">
<h1 className="text-white py-2">Name of the Topic</h1>
Expand All @@ -62,12 +62,12 @@ function EditBody({ setOpenModal, openModal, bodyDetails }) {
value={formData?.content}
onChange={handleChange}
rows={8}
className="w-full rounded-md bg-gray-700 text-white"
className="w-full rounded-md bg-gray-700 text-white "
></textarea>
</label>
</div>
<button
className="text-primary border-2 px-5 py-1 hover:bg-primary hover:text-black rounded-md float-end"
className="text-white border-0 px-5 py-1 hover:bg-primary bg-gray-500 hover:text-black rounded-md float-end"
onClick={handleEdit}
>
Update
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Features/Features.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default function Features() {
</svg>
</div>
<h4 className="mb-3 text-xl font-bold text-white dark:text-white">
Safity
Safety
</h4>
<p className="mb-8 text-gray-200 dark:text-white-6 lg:mb-9">
Ensure complete safety in chatting and communication. Our
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Sidebar() {
<button className="flex items-center px-4 py-2 rounded-md w-full mt-8 hover:bg-gray-800">
<TbFileReport className="text-primary" />
<Link className="ml-4 font-bold text-gray-500" to={"/admin/rights"}>
Rights Management
My Right
</Link>
</button>
<button className="flex items-center px-4 py-2 rounded-md w-full mt-8 hover:bg-gray-800">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function RecentDiscussions() {
return (
<div className="">
<h1>recent discussions</h1>
</div>
)
}
5 changes: 2 additions & 3 deletions client/src/pages/AdminPages/Home/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import Figure from "../../../components/Figure/Figure";
// import Figure from "../../../components/Figure/Figure";

function Home() {
return (
<>
<div className="h-screen bg-background">
<div className="col-span-9">
<div className="flex justify-around py-5">
<Figure />
<Figure />
{/* <Figure /> */}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/AdminPages/Managment/Managment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function Managment() {
return (
<>
<tbody key={index}>
<tr className="border-b">
<tr className="border-b border-gray-600">
<th scope="row" className="px-6 py-4 font-medium">
{user?.fullname}
</th>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/AdminPages/MyBody/MyBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function MyBody() {
</div>
<div className="px-8">
<button
className="text-xl py-12 text-pretty text-primary underline"
className="text-xl py-12 text-pretty text-primary"
onClick={handleModal}
>
Create
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/AdminPages/Rights/Rights.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Rights() {
{/* Text Components */}
<div className="text-text flex justify-between">
<div>
<h1 className="text-2xl py-12">Rights Management</h1>
<h1 className="text-2xl py-12">My Rights</h1>
</div>
<div className="px-8">
<button
Expand Down Expand Up @@ -97,7 +97,7 @@ function Rights() {
return (
<>
<tbody className="text-text" key={index}>
<tr className="border-b border-gray-500">
<tr className="border-b border-gray-600">
<th scope="row" className="px-6 py-4 font-medium">
{index + 1}
</th>
Expand Down
10 changes: 0 additions & 10 deletions client/src/pages/UserPages/Community/Community.css
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
.sidebar {
height: calc(100vh - 70px);
}
.sidebar .nav .item {
cursor: pointer;
}

.page-body {
height: calc(100vh - 70px);
}
123 changes: 104 additions & 19 deletions client/src/pages/UserPages/Community/Community.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import AddCircle from "@mui/icons-material/AddCircle";
import "./Community.css";
import MenuIcon from "@mui/icons-material/Menu";
// import MenuIcon from "@mui/icons-material/Menu";
import { useState } from "react";
// import NewCommunity from "../../components/Modal/NewCommunity";
// import YourCommunity from "../../components/community/YourCommunity";
// import DiscoverCommunity from "../../components/community/DiscoverCommunity";
import { useNavigate, useParams } from "react-router-dom";
// import RecentDiscussions from "../../components/community/RecentDiscussions";
import NewCommunity from "../../../components/community/NewCommunity";
import RecentDiscussions from "../../../components/community/RecentDiscussions/RecentDiscussions";

export default function Community() {
const { tab } = useParams();
Expand All @@ -16,24 +17,108 @@ export default function Community() {
const [currentTab, setCurrentTab] = useState(tab.toUpperCase());
const [showNewCommunity, setShowNewCommunity] = useState(false);
return (
<div className="bg-red-600">
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<h1>dhsfs</h1>
<div className="community bg-background">
<NewCommunity
showModal={showNewCommunity}
setShowModal={setShowNewCommunity}
/>
{/* <div className="flex gap-2 col-span-12">
<button
className="p-2 sm:hidden flex rounded-sm mb-3"
onClick={() =>
setShowSidebar(
showSidebar === "block" ? "hidden" : "block"
)
}
>
<MenuIcon />
</button>
<h1
className={`${
showSidebar === "block" ? "hidden" : "block"
} sm:hidden text-xl mt-2`}
>
Community
</h1>
</div> */}
<section
className={`sidebar fixed bg-background h-screen sm:w-96 text-text flex flex-col p-5 py-8 ${showSidebar} sm:block`}
>
<h1 className="text-2xl mb-10">Community</h1>
{/* <div className="search my-5">
<input
type="text"
placeholder="search communities"
className="bg-gray-800 rounded-md w-full"
/>
</div> */}
<div
className="nav flex flex-col gap-3"
onClick={() =>
setShowSidebar(
showSidebar === "block" ? "hidden" : "block"
)
}
>
<div
className={`item hover:bg-gray-800 ${
currentTab === "RECENT_DISCUSSIONS" &&
"bg-gray-800"
} rounded-md p-5 py-3`}
onClick={() => {
setCurrentTab("RECENT_DISCUSSIONS");
navigate("/community/recent_discussions");
}}
>
<h2 className="text-lg">Recent Discussions</h2>
</div>
<div
className={`item hover:bg-gray-800 ${
currentTab === "DISCOVER" && "bg-gray-800"
} rounded-md p-5 py-3`}
onClick={() => {
setCurrentTab("DISCOVER");
navigate("/community/discover");
}}
>
<h2 className="text-lg">Discover</h2>
</div>
<div
className={`item hover:bg-gray-800 ${
currentTab === "YOUR_COMMUNITY" &&
"bg-gray-800"
} rounded-md p-5 py-3`}
onClick={() => {
setCurrentTab("YOUR_COMMUNITY");
navigate("/community/your_community");
}}
>
<h2 className="text-lg">Your Community</h2>
</div>
</div>
<div className="new-community mt-7 px-5 py-3 bg-gray-800 hover:bg-gray-600 cursor-pointer rounded-md">
<button
className="text-lg flex gap-3"
onClick={() => setShowNewCommunity(true)}
>
<div className="text-primary">
<AddCircle />
</div>
Community
</button>
</div>
</section>
<section className="page-body bg-blue-700">
{currentTab === "RECENT_DISCUSSIONS" ? (
<RecentDiscussions />
) : // <RecentDiscussions />
// : currentTab === "DISCOVER" ? (
// <DiscoverCommunity />
// ) : currentTab === "YOUR_COMMUNITY" ? (
// <YourCommunity />
// )
null}
</section>
</div>
);
}
2 changes: 1 addition & 1 deletion server/middlewares/authMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const mongoose = require('mongoose');
const isLogedIn = async (req, res, next) => {
try {
const token = req.cookies.token;
console.log(token)
console.log(req.cookies)
if (token) {
const decoded = jwt.verify(token, process.env.JWT_SECRET);
const userId = new mongoose.Types.ObjectId(decoded.id)
Expand Down

0 comments on commit 9cd7787

Please sign in to comment.