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 1
1
import React from "react" ;
2
2
import styled , { css } from "styled-components" ;
3
3
4
+ import { useParams } from "react-router-dom" ;
5
+
4
6
import PaperclipIcon from "svgs/icons/paperclip.svg" ;
5
7
import PolicyIcon from "svgs/icons/policy.svg" ;
6
8
@@ -67,17 +69,23 @@ interface IPolicies {
67
69
}
68
70
69
71
export const Policies : React . FC < IPolicies > = ( { disputePolicyURI, courtId, attachment } ) => {
72
+ const { id } = useParams ( ) ;
73
+
70
74
return (
71
75
< Container >
72
76
< StyledP > Policy documents:</ StyledP >
73
77
{ ! 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
+ >
75
81
< StyledPaperclipIcon />
76
82
{ attachment . label ?? "Attachment" }
77
83
</ StyledInternalLink >
78
84
) : null }
79
85
{ 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
+ >
81
89
< StyledPolicyIcon />
82
90
Dispute Policy
83
91
</ StyledInternalLink >
Original file line number Diff line number Diff line change @@ -68,9 +68,18 @@ const Header: React.FC<{ title: string }> = ({ title }) => {
68
68
const navigate = useNavigate ( ) ;
69
69
const [ searchParams ] = useSearchParams ( ) ;
70
70
const disputeId = searchParams . get ( "disputeId" ) ;
71
+ const attachmentTitle = searchParams . get ( "title" ) ;
71
72
72
73
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
+ }
74
83
} ;
75
84
76
85
return (
You can’t perform that action at this time.
0 commit comments