From 113ec184792d4e405e62c31d6bfa64330ea39ad1 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Thu, 26 May 2022 20:27:39 +0300 Subject: [PATCH] fix: fix some QA issues - fix navbar height - remove input shadow - change donateCard options style - add 2px borders to cards - remove search from nav on sections other than products - implement useMediaQuery --- src/App.tsx | 13 ++-- .../Navbar/CategoriesList/CategoriesList.tsx | 13 ++-- src/Components/Navbar/NavDesktop.tsx | 34 +++------- src/Components/Navbar/NavMobile.tsx | 8 +-- src/Components/Navbar/Navbar.tsx | 42 ++++-------- .../components/DonateCard/DonateCard.tsx | 9 +-- .../Donations/pages/DonatePage/DonatePage.tsx | 2 +- .../HackathonCard/HackathonCard.tsx | 2 +- .../Components/SortByFilter/SortByFilter.tsx | 4 +- .../Components/TopicsFilter/TopicsFilter.tsx | 2 +- .../pages/HackathonsPage/HackathonsPage.tsx | 2 +- .../pages/HackathonsPage/styles.module.scss | 4 +- .../PopularTopicsFilter.tsx | 2 +- .../Posts/pages/FeedPage/SortBy/SortBy.tsx | 2 +- src/styles/tw.scss | 68 +++++++++---------- src/utils/hooks/index.ts | 2 + src/utils/hooks/useCurrentSection.ts | 18 +++++ src/utils/hooks/useMediaQuery.ts | 43 ++++++++++++ 18 files changed, 150 insertions(+), 120 deletions(-) create mode 100644 src/utils/hooks/useCurrentSection.ts create mode 100644 src/utils/hooks/useMediaQuery.ts diff --git a/src/App.tsx b/src/App.tsx index 8c40b9d..bce69a8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,7 @@ import Navbar from "src/Components/Navbar/Navbar"; import ModalsContainer from "src/Components/Modals/ModalsContainer/ModalsContainer"; import { useAppSelector } from './utils/hooks'; import { Wallet_Service } from "./services"; -import { Route, Routes } from "react-router-dom"; +import { Navigate, Route, Routes } from "react-router-dom"; import { useWrapperSetup } from "./utils/Wrapper"; import LoadingPage from "./Components/LoadingPage/LoadingPage"; @@ -45,13 +45,18 @@ function App() { }> - } /> - } /> + } /> + } /> + } /> + } /> } /> + } /> + } /> - } /> + + } /> diff --git a/src/Components/Navbar/CategoriesList/CategoriesList.tsx b/src/Components/Navbar/CategoriesList/CategoriesList.tsx index 92979d4..b682f6f 100644 --- a/src/Components/Navbar/CategoriesList/CategoriesList.tsx +++ b/src/Components/Navbar/CategoriesList/CategoriesList.tsx @@ -33,13 +33,14 @@ export default function CategoriesList({ classes = {}, onClick }: Props) { <> {data?.allCategories.map(category => { - onClick?.(category.id) - navigate(`/category/${category.id}`) - }} key={category.id} - href={`/category/${category.id}`} + className={`w-full !p-16 text-body4 font-semibold hover:bg-gray-100 !rounded-8 flex w-items-center ${classes.item}`} + href={`/products/category/${category.id}`} + onClick={(e) => { + e.syntheticEvent.preventDefault(); + onClick?.(category.id) + navigate(`/products/category/${category.id}`) + }} > {category.icon} {category.title} {numberFormatter(category.votes_sum)} diff --git a/src/Components/Navbar/NavDesktop.tsx b/src/Components/Navbar/NavDesktop.tsx index b69060a..fa29a95 100644 --- a/src/Components/Navbar/NavDesktop.tsx +++ b/src/Components/Navbar/NavDesktop.tsx @@ -1,7 +1,7 @@ import { BsSearch } from "react-icons/bs"; import { motion } from "framer-motion"; -import { useAppDispatch, useAppSelector } from "src/utils/hooks"; +import { useAppDispatch, useAppSelector, useCurrentSection } from "src/utils/hooks"; import { openModal } from "src/redux/features/modals.slice"; import Button from "../Button/Button"; import ASSETS from "src/assets"; @@ -46,27 +46,11 @@ export default function NavDesktop() { }; - - const onConnectWallet = () => { - dispatch( - openModal({ - Modal: "Login_ScanningWalletCard", - }) - ); - }; - - const onWithdraw = () => { - dispatch( - openModal({ - Modal: "Claim_FundWithdrawCard", - }) - ); - }; - + const currentSection = useCurrentSection(); const navigate = useNavigate() - return (