Skip to content

Commit b3041c4

Browse files
committed
feat(web): add-open-in-new-tab-option
1 parent 6430dcd commit b3041c4

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

web/src/assets/svgs/icons/new-tab.svg

+3
Loading

web/src/pages/Cases/AttachmentDisplay/Header.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const Container = styled.div`
1515
display: flex;
1616
justify-content: space-between;
1717
align-items: center;
18+
margin-bottom: 38px;
1819
`;
1920

2021
const TitleContainer = styled.div`

web/src/pages/Cases/AttachmentDisplay/index.tsx

+32-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import styled from "styled-components";
33

44
import { useSearchParams } from "react-router-dom";
55

6+
import NewTabIcon from "svgs/icons/new-tab.svg";
7+
68
import Loader from "components/Loader";
79

810
import Header from "./Header";
@@ -13,7 +15,7 @@ const Container = styled.div`
1315
width: 100%;
1416
display: flex;
1517
flex-direction: column;
16-
gap: 47px;
18+
gap: 8px;
1719
`;
1820

1921
const DisplayContainer = styled.div`
@@ -30,6 +32,19 @@ const LoaderContainer = styled.div`
3032
justify-content: center;
3133
`;
3234

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+
3348
const EvidenceAttachmentDisplay: React.FC = () => {
3449
const [searchParams] = useSearchParams();
3550

@@ -38,17 +53,22 @@ const EvidenceAttachmentDisplay: React.FC = () => {
3853
<Container>
3954
<Header />
4055
{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+
</>
5272
) : null}
5373
</Container>
5474
);

0 commit comments

Comments
 (0)