File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
components/DisputePreview Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
22import styled , { css } from "styled-components" ;
33
4+ import { useParams } from "react-router-dom" ;
5+
46import PaperclipIcon from "svgs/icons/paperclip.svg" ;
57import PolicyIcon from "svgs/icons/policy.svg" ;
68
@@ -67,17 +69,23 @@ interface IPolicies {
6769}
6870
6971export const Policies : React . FC < IPolicies > = ( { disputePolicyURI, courtId, attachment } ) => {
72+ const { id } = useParams ( ) ;
73+
7074 return (
7175 < Container >
7276 < StyledP > Policy documents:</ StyledP >
7377 { ! isUndefined ( attachment ) && ! isUndefined ( attachment . uri ) ? (
74- < StyledInternalLink to = { `/attachment/?title=${ "Case Policy" } &url=${ getIpfsUrl ( attachment . uri ) } ` } >
78+ < StyledInternalLink
79+ to = { `/attachment/?disputeId=${ id } &title=${ "Case Policy" } &url=${ getIpfsUrl ( attachment . uri ) } ` }
80+ >
7581 < StyledPaperclipIcon />
7682 { attachment . label ?? "Attachment" }
7783 </ StyledInternalLink >
7884 ) : null }
7985 { isUndefined ( disputePolicyURI ) ? null : (
80- < StyledInternalLink to = { `/attachment/?title=${ "Dispute Policy" } &url=${ getIpfsUrl ( disputePolicyURI ) } ` } >
86+ < StyledInternalLink
87+ to = { `/attachment/?disputeId=${ id } &title=${ "Dispute Policy" } &url=${ getIpfsUrl ( disputePolicyURI ) } ` }
88+ >
8189 < StyledPolicyIcon />
8290 Dispute Policy
8391 </ StyledInternalLink >
Original file line number Diff line number Diff line change @@ -68,9 +68,18 @@ const Header: React.FC<{ title: string }> = ({ title }) => {
6868 const navigate = useNavigate ( ) ;
6969 const [ searchParams ] = useSearchParams ( ) ;
7070 const disputeId = searchParams . get ( "disputeId" ) ;
71+ const attachmentTitle = searchParams . get ( "title" ) ;
7172
7273 const handleReturn = ( ) => {
73- navigate ( `/cases/${ disputeId } /evidence` ) ;
74+ if ( attachmentTitle === "Evidence File" ) {
75+ navigate ( `/cases/${ disputeId } /evidence` ) ;
76+ } else if ( attachmentTitle === "Case Policy" || attachmentTitle === "Dispute Policy" ) {
77+ navigate ( `/cases/${ disputeId } /overview` ) ;
78+ } else if ( attachmentTitle === "Policy File" ) {
79+ navigate ( `/resolver/policy` ) ;
80+ } else {
81+ navigate ( "/" ) ;
82+ }
7483 } ;
7584
7685 return (
You can’t perform that action at this time.
0 commit comments