File tree 3 files changed +36
-12
lines changed
pages/Cases/AttachmentDisplay
3 files changed +36
-12
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const Container = styled.div`
15
15
display: flex;
16
16
justify-content: space-between;
17
17
align-items: center;
18
+ margin-bottom: 38px;
18
19
` ;
19
20
20
21
const TitleContainer = styled . div `
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import styled from "styled-components";
3
3
4
4
import { useSearchParams } from "react-router-dom" ;
5
5
6
+ import NewTabIcon from "svgs/icons/new-tab.svg" ;
7
+
6
8
import Loader from "components/Loader" ;
7
9
8
10
import Header from "./Header" ;
@@ -13,7 +15,7 @@ const Container = styled.div`
13
15
width: 100%;
14
16
display: flex;
15
17
flex-direction: column;
16
- gap: 47px ;
18
+ gap: 8px ;
17
19
` ;
18
20
19
21
const DisplayContainer = styled . div `
@@ -30,6 +32,19 @@ const LoaderContainer = styled.div`
30
32
justify-content: center;
31
33
` ;
32
34
35
+ const NewTabInfo = styled . a `
36
+ align-self: flex-end;
37
+ display: flex;
38
+ gap: 8px;
39
+ align-items: center;
40
+ ` ;
41
+
42
+ const StyledNewTabIcon = styled ( NewTabIcon ) `
43
+ path {
44
+ fill: ${ ( { theme } ) => theme . primaryBlue } ;
45
+ }
46
+ ` ;
47
+
33
48
const EvidenceAttachmentDisplay : React . FC = ( ) => {
34
49
const [ searchParams ] = useSearchParams ( ) ;
35
50
@@ -38,17 +53,22 @@ const EvidenceAttachmentDisplay: React.FC = () => {
38
53
< Container >
39
54
< Header />
40
55
{ url ? (
41
- < Suspense
42
- fallback = {
43
- < LoaderContainer >
44
- < Loader width = { "48px" } height = { "48px" } />
45
- </ LoaderContainer >
46
- }
47
- >
48
- < DisplayContainer >
49
- < FileViewer url = { url } />
50
- </ DisplayContainer >
51
- </ Suspense >
56
+ < >
57
+ < NewTabInfo href = { url } rel = "noreferrer" target = "_blank" >
58
+ Open in new tab < StyledNewTabIcon />
59
+ </ NewTabInfo >
60
+ < Suspense
61
+ fallback = {
62
+ < LoaderContainer >
63
+ < Loader width = { "48px" } height = { "48px" } />
64
+ </ LoaderContainer >
65
+ }
66
+ >
67
+ < DisplayContainer >
68
+ < FileViewer url = { url } />
69
+ </ DisplayContainer >
70
+ </ Suspense >
71
+ </ >
52
72
) : null }
53
73
</ Container >
54
74
) ;
You can’t perform that action at this time.
0 commit comments