From 40d5162359cd7b7109cfbdf7b5f2008198420d69 Mon Sep 17 00:00:00 2001 From: Shubham-Lal Date: Sat, 27 Apr 2024 00:03:35 +0530 Subject: [PATCH] client: modify auth layout --- .../components/card/closed-debate-card.tsx | 4 +-- .../src/components/card/open-debate-card.tsx | 4 +-- client/src/components/modal/auth/index.css | 36 +++++++++++++++++++ client/src/components/modal/auth/index.tsx | 34 ++++++++++++++---- 4 files changed, 67 insertions(+), 11 deletions(-) diff --git a/client/src/components/card/closed-debate-card.tsx b/client/src/components/card/closed-debate-card.tsx index 69f3957..d8bd1b8 100644 --- a/client/src/components/card/closed-debate-card.tsx +++ b/client/src/components/card/closed-debate-card.tsx @@ -1,7 +1,7 @@ import "./closed-debate-card.css" import { Link } from "react-router-dom" import DebateBar from "./debate-bar" -import { FaComments } from "react-icons/fa" +import { MdModeComment } from "react-icons/md" import useFormatNumber from "../../hooks/useFormatNumber" const ClosedDebateCard = () => { @@ -33,7 +33,7 @@ const ClosedDebateCard = () => {
- +

{useFormatNumber(1300)}

5 days ago

diff --git a/client/src/components/card/open-debate-card.tsx b/client/src/components/card/open-debate-card.tsx index 751d5d7..8c64c8b 100644 --- a/client/src/components/card/open-debate-card.tsx +++ b/client/src/components/card/open-debate-card.tsx @@ -1,6 +1,6 @@ import "./open-debate-card.css" import { Link } from "react-router-dom" -import { FaComments } from "react-icons/fa" +import { MdModeComment } from "react-icons/md" import { IoCaretUpSharp } from "react-icons/io5" import useFormatNumber from "../../hooks/useFormatNumber" @@ -26,7 +26,7 @@ const OpenDebateCard = () => {

{useFormatNumber(4500)}

- +

{useFormatNumber(1300)}

diff --git a/client/src/components/modal/auth/index.css b/client/src/components/modal/auth/index.css index 419abc3..5042220 100644 --- a/client/src/components/modal/auth/index.css +++ b/client/src/components/modal/auth/index.css @@ -46,6 +46,27 @@ padding: 20px; } +.auth__container .logo__wrapper { + display: none; + position: absolute; + top: 10px; + left: 10px; + width: 40px; + height: 40px; +} + +.auth__container .logo__wrapper img { + width: 100%; + height: 100%; +} + +.auth__container .theme-btn { + display: none; + position: absolute; + top: 10px; + right: 60px; +} + .close__btn { position: absolute; top: 0; @@ -286,6 +307,21 @@ border-radius: unset; } + .auth__container .logo__wrapper { + display: block; + } + + .auth__container .theme-btn { + display: grid; + } + + .auth__container .close__btn { + top: 10px; + right: 10px; + background-color: var(--explore_input_bg); + border-radius: 50%; + } + .auth__container .left__container { display: flex; margin: 0 auto; diff --git a/client/src/components/modal/auth/index.tsx b/client/src/components/modal/auth/index.tsx index 80bc522..5d72d9a 100644 --- a/client/src/components/modal/auth/index.tsx +++ b/client/src/components/modal/auth/index.tsx @@ -1,8 +1,9 @@ import "./index.css" import { useState } from "react" -import { useLocation } from "react-router-dom" +import { Link, useLocation } from "react-router-dom" import Lottie from "lottie-react" import { useAuthStore, AuthTab, useTempStore } from "../../../store/useAuthStore" +import { Theme, useNavStore } from "../../../store/useNavStore" import WavingHand from "../../../lottie/WavingHand.json" import LoginTab from "./login-tab" import SignupTab from "./signup-tab" @@ -21,6 +22,7 @@ type RegisterData = { const AuthModal = () => { const location = useLocation(); const { authTab, setAuthTab } = useAuthStore(); + const { theme, setTheme } = useNavStore(); const { tempUser } = useTempStore(); const [registerData, setRegisterData] = useState(() => ({ @@ -32,6 +34,12 @@ const AuthModal = () => { last_name: tempUser.last_name || "" })); + const handleToggleTheme = () => { + const newTheme = theme === Theme.Light ? Theme.Dark : Theme.Light; + document.querySelector("body")?.setAttribute('data-theme', newTheme); + setTheme(newTheme); + } + const handleBackgroundClick = (event: React.MouseEvent) => { if (location.pathname !== '/auth' && event.target === event.currentTarget) { setAuthTab(AuthTab.Closed); @@ -64,12 +72,24 @@ const AuthModal = () => { )} {location.pathname !== '/auth' && ( - + <> + + + + + + )}