@@ -4,6 +4,9 @@ import Search from "./Search";
44import StatsAndFilters from "./StatsAndFilters" ;
55import CasesGrid , { ICasesGrid } from "./CasesGrid" ;
66import { responsiveSize } from "styles/responsiveSize" ;
7+ import LightButton from "../LightButton" ;
8+ import ArrowIcon from "assets/svgs/icons/arrow.svg" ;
9+ import { useLocation , useNavigate } from "react-router-dom" ;
710
811const Divider = styled . hr `
912 display: flex;
@@ -12,9 +15,26 @@ const Divider = styled.hr`
1215 background-color: ${ ( { theme } ) => theme . stroke } ;
1316 margin: ${ responsiveSize ( 20 , 24 ) } ;
1417` ;
18+ const TitleContainer = styled . div `
19+ display: flex;
20+ justify-content: space-between;
21+ align-items: center;
22+ flex-wrap: wrap;
23+ margin-bottom: ${ responsiveSize ( 32 , 48 ) } ;
24+ ` ;
1525
1626const StyledTitle = styled . h1 `
17- margin-bottom: ${ responsiveSize ( 32 , 48 ) } ;
27+ margin: 0px;
28+ ` ;
29+
30+ const StyledButton = styled ( LightButton ) `
31+ display: flex;
32+ flex-direction: row-reverse;
33+ gap: 8px;
34+ > .button-text {
35+ color: ${ ( { theme } ) => theme . primaryBlue } ;
36+ }
37+ padding: 0px;
1838` ;
1939
2040interface ICasesDisplay extends ICasesGrid {
@@ -35,9 +55,16 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
3555 className,
3656 totalPages,
3757} ) => {
58+ const navigate = useNavigate ( ) ;
59+ const location = useLocation ( ) ;
3860 return (
3961 < div { ...{ className } } >
40- < StyledTitle > { title } </ StyledTitle >
62+ < TitleContainer className = "title" >
63+ < StyledTitle > { title } </ StyledTitle >
64+ { location . pathname . startsWith ( "/cases/display/1/desc/all" ) ? (
65+ < StyledButton onClick = { ( ) => navigate ( `/resolver` ) } text = "Create a case" Icon = { ArrowIcon } />
66+ ) : null }
67+ </ TitleContainer >
4168 < Search />
4269 < StatsAndFilters totalDisputes = { numberDisputes ?? 0 } closedDisputes = { numberClosedDisputes ?? 0 } />
4370 < Divider />
0 commit comments