From 772c3a8959967ccaed73c3467d68d4f10978b8d3 Mon Sep 17 00:00:00 2001 From: kemuru <102478601+kemuru@users.noreply.github.com> Date: Tue, 10 Dec 2024 21:15:03 +0100 Subject: [PATCH] fix: change kleros logo, footer logo, delete verdict file, bit of gap in explore, fix bug in court --- .../assets/svgs/footer/secured-by-kleros.svg | 12 ++-- web/src/assets/svgs/header/kleros-court.svg | 12 +--- web/src/components/Verdict/VerdictBanner.tsx | 58 ------------------- web/src/layout/Header/navbar/Explore.tsx | 3 +- .../pages/Courts/CourtDetails/Description.tsx | 29 ++++------ 5 files changed, 19 insertions(+), 95 deletions(-) delete mode 100644 web/src/components/Verdict/VerdictBanner.tsx diff --git a/web/src/assets/svgs/footer/secured-by-kleros.svg b/web/src/assets/svgs/footer/secured-by-kleros.svg index eac640c7a..cceaf5c05 100644 --- a/web/src/assets/svgs/footer/secured-by-kleros.svg +++ b/web/src/assets/svgs/footer/secured-by-kleros.svg @@ -1,12 +1,10 @@ - - - - - + + + - - + + diff --git a/web/src/assets/svgs/header/kleros-court.svg b/web/src/assets/svgs/header/kleros-court.svg index dc698e7ae..271675f2e 100644 --- a/web/src/assets/svgs/header/kleros-court.svg +++ b/web/src/assets/svgs/header/kleros-court.svg @@ -1,11 +1,3 @@ - - - - - - - - - - + + diff --git a/web/src/components/Verdict/VerdictBanner.tsx b/web/src/components/Verdict/VerdictBanner.tsx deleted file mode 100644 index 3c5bf544f..000000000 --- a/web/src/components/Verdict/VerdictBanner.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React from "react"; -import styled from "styled-components"; - -import ClosedCaseIcon from "svgs/icons/check-circle-outline.svg"; -import HourglassIcon from "svgs/icons/hourglass.svg"; - -const BannerContainer = styled.div` - display: flex; - gap: 8px; - align-items: center; - svg { - width: 16px; - height: 16px; - } -`; - -const VerdictTag = styled.small<{ ruled: boolean }>` - font-weight: 400; - line-height: 19px; - color: ${({ theme, ruled }) => (ruled ? theme.success : theme.primaryText)}; -`; - -const StyledHourglassIcon = styled(HourglassIcon)` - fill: ${({ theme }) => theme.primaryText}; -`; - -interface IVerdictIcon { - ruled: boolean; -} - -const VerdictIcon: React.FC = ({ ruled }) => { - return ruled ? : ; -}; - -interface IVerdictText { - ruled: boolean; -} - -const VerdictText: React.FC = ({ ruled }) => { - return ruled ? <>Case closed : <>Case ongoing; -}; - -interface IVerdictBanner { - ruled: boolean; -} - -const VerdictBanner: React.FC = ({ ruled }) => { - return ( - - - - - - - ); -}; - -export default VerdictBanner; diff --git a/web/src/layout/Header/navbar/Explore.tsx b/web/src/layout/Header/navbar/Explore.tsx index fb5209ced..bc1347dc5 100644 --- a/web/src/layout/Header/navbar/Explore.tsx +++ b/web/src/layout/Header/navbar/Explore.tsx @@ -8,7 +8,6 @@ import { useOpenContext } from "../MobileHeader"; const Container = styled.div` display: flex; - gap: 0; flex-direction: column; ${landscapeStyle( @@ -46,7 +45,7 @@ const StyledLink = styled(Link)<{ isActive: boolean; isMobileNavbar?: boolean }> ${landscapeStyle( () => css` color: ${({ isActive, theme }) => (isActive ? theme.white : `${theme.white}BA`)}; - padding: 16px 8px; + padding: 16px 10px; ` )}; `; diff --git a/web/src/pages/Courts/CourtDetails/Description.tsx b/web/src/pages/Courts/CourtDetails/Description.tsx index e48e715ac..8cce1a985 100644 --- a/web/src/pages/Courts/CourtDetails/Description.tsx +++ b/web/src/pages/Courts/CourtDetails/Description.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React from "react"; import styled from "styled-components"; import ReactMarkdown from "react-markdown"; @@ -61,26 +61,23 @@ const Description: React.FC = () => { const { id } = useParams(); const { data: policy } = useCourtPolicy(id); const navigate = useNavigate(); - const currentPathName = useLocation().pathname.split("/").at(-1); - const [currentTab, setCurrentTab] = useState(TABS.findIndex(({ path }) => path === currentPathName)); - useEffect(() => setCurrentTab(TABS.findIndex(({ path }) => path === currentPathName)), [currentPathName]); + const location = useLocation(); + const currentPathName = location.pathname.split("/").at(-1); const filteredTabs = TABS.filter(({ isVisible }) => isVisible(policy)); + const currentTab = TABS.findIndex(({ path }) => path === currentPathName); + + const handleTabChange = (index: number) => { + navigate(TABS[index].path); + }; return ( - { - setCurrentTab(n); - navigate(TABS[n].path); - }} - /> + - {policy?.requiredSkills}

} /> + { }; const formatMarkdown = (markdown?: string) => - markdown ? ( - {typeof markdown === "string" ? markdown.replace(/\n/g, " \n") : markdown} - ) : ( - - ); + markdown ? {markdown.replace(/\n/g, " \n")} : ; export default Description;