From 8cd298eaab4e57f98e0c46e891d1062a54e66fe0 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Sun, 25 Feb 2024 21:07:54 +0530 Subject: [PATCH 1/2] feat(web): add-create-a-case-button-in-cases-display --- web/src/components/CasesDisplay/index.tsx | 31 +++++++++++++++++++++-- web/src/pages/Dashboard/index.tsx | 2 +- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/web/src/components/CasesDisplay/index.tsx b/web/src/components/CasesDisplay/index.tsx index 51a610ff1..75fe60bd2 100644 --- a/web/src/components/CasesDisplay/index.tsx +++ b/web/src/components/CasesDisplay/index.tsx @@ -4,6 +4,9 @@ import Search from "./Search"; import StatsAndFilters from "./StatsAndFilters"; import CasesGrid, { ICasesGrid } from "./CasesGrid"; import { responsiveSize } from "styles/responsiveSize"; +import LightButton from "../LightButton"; +import ArrowIcon from "assets/svgs/icons/arrow.svg"; +import { useLocation, useNavigate } from "react-router-dom"; const Divider = styled.hr` display: flex; @@ -12,9 +15,26 @@ const Divider = styled.hr` background-color: ${({ theme }) => theme.stroke}; margin: ${responsiveSize(20, 24)}; `; +const TitleContainer = styled.div` + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + margin-bottom: ${responsiveSize(32, 48)}; +`; const StyledTitle = styled.h1` - margin-bottom: ${responsiveSize(32, 48)}; + margin: 0px; +`; + +const StyledButton = styled(LightButton)` + display: flex; + flex-direction: row-reverse; + gap: 8px; + > .button-text { + color: ${({ theme }) => theme.primaryBlue}; + } + padding: 0px; `; interface ICasesDisplay extends ICasesGrid { @@ -35,9 +55,16 @@ const CasesDisplay: React.FC = ({ className, totalPages, }) => { + const navigate = useNavigate(); + const location = useLocation(); return (
- {title} + + {title} + {location.pathname.startsWith("/cases/display/1/desc/all") ? ( + navigate(`/resolver`)} text="Create a case" Icon={ArrowIcon} /> + ) : null} + diff --git a/web/src/pages/Dashboard/index.tsx b/web/src/pages/Dashboard/index.tsx index 26f3b3ef4..d5c55b07e 100644 --- a/web/src/pages/Dashboard/index.tsx +++ b/web/src/pages/Dashboard/index.tsx @@ -24,7 +24,7 @@ const Container = styled.div` const StyledCasesDisplay = styled(CasesDisplay)` margin-top: 64px; - h1 { + .title { margin-bottom: ${responsiveSize(16, 48)}; } `; From 322fbef8b6297c52d00778a24563fb793d5ca6c0 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Sun, 25 Feb 2024 21:14:15 +0530 Subject: [PATCH 2/2] fix(web): fix-toast-info-in-policy-upload --- web/src/pages/Resolver/Policy/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/Resolver/Policy/index.tsx b/web/src/pages/Resolver/Policy/index.tsx index dcf6e0172..84fba03d3 100644 --- a/web/src/pages/Resolver/Policy/index.tsx +++ b/web/src/pages/Resolver/Policy/index.tsx @@ -47,7 +47,7 @@ const Policy: React.FC = () => { const fileFormData = new FormData(); fileFormData.append("data", file, file.name); - uploadFormDataToIPFS(fileFormData) + uploadFormDataToIPFS(fileFormData, "policy") .then(async (res) => { const response = await res.json(); const policyURI = response["cids"][0];