1
1
import React from "react" ;
2
- import styled , { css } from "styled-components" ;
2
+ import styled from "styled-components" ;
3
3
4
4
import PaperclipIcon from "svgs/icons/paperclip.svg" ;
5
5
import PolicyIcon from "svgs/icons/policy.svg" ;
6
6
7
7
import { getIpfsUrl } from "utils/getIpfsUrl" ;
8
8
import { isUndefined } from "utils/index" ;
9
9
10
- import { landscapeStyle } from "styles/landscapeStyle" ;
11
10
import { responsiveSize } from "styles/responsiveSize" ;
12
11
13
12
import { InternalLink } from "components/InternalLink" ;
14
13
15
- const ShadeArea = styled . div `
14
+ const Container = styled . div `
16
15
display: flex;
17
- flex-direction: column;
18
- justify-content: center;
19
- width: 100%;
16
+ align-items: center;
17
+ flex-direction: row;
18
+ flex-wrap: wrap;
19
+ gap: 8px 16px;
20
20
padding: ${ responsiveSize ( 16 , 20 ) } ${ responsiveSize ( 16 , 32 ) } ;
21
- margin-top: 16px;
22
21
background-color: ${ ( { theme } ) => theme . mediumBlue } ;
23
-
24
- ${ landscapeStyle (
25
- ( ) => css `
26
- flex-direction: row;
27
- justify-content: space-between;
28
- `
29
- ) } ;
30
22
` ;
31
23
32
24
const StyledP = styled . p `
33
25
font-size: 14px;
34
- margin-top: 0;
35
- margin-bottom: 16px;
26
+ margin: 0;
36
27
color: ${ ( { theme } ) => theme . primaryBlue } ;
37
- ${ landscapeStyle (
38
- ( ) => css `
39
- margin-bottom: 0;
40
- `
41
- ) } ;
42
28
` ;
43
29
44
30
const StyledPolicyIcon = styled ( PolicyIcon ) `
@@ -51,13 +37,6 @@ const StyledPaperclipIcon = styled(PaperclipIcon)`
51
37
fill: ${ ( { theme } ) => theme . primaryBlue } ;
52
38
` ;
53
39
54
- const LinkContainer = styled . div `
55
- display: flex;
56
- gap: ${ responsiveSize ( 16 , 24 ) } ;
57
- flex-wrap: wrap;
58
- align-items: center;
59
- ` ;
60
-
61
40
const StyledInternalLink = styled ( InternalLink ) `
62
41
display: flex;
63
42
gap: 4px;
@@ -82,28 +61,26 @@ interface IPolicies {
82
61
83
62
export const Policies : React . FC < IPolicies > = ( { disputePolicyURI, courtId, attachment } ) => {
84
63
return (
85
- < ShadeArea >
86
- < StyledP > Make sure you read and understand the Policies</ StyledP >
87
- < LinkContainer >
88
- { ! isUndefined ( attachment ) && ! isUndefined ( attachment . uri ) ? (
89
- < StyledInternalLink to = { `attachment/?url=${ getIpfsUrl ( attachment . uri ) } ` } >
90
- < StyledPaperclipIcon />
91
- { attachment . label ?? "Attachment" }
92
- </ StyledInternalLink >
93
- ) : null }
94
- { isUndefined ( disputePolicyURI ) ? null : (
95
- < StyledInternalLink to = { `policy/attachment/?url=${ getIpfsUrl ( disputePolicyURI ) } ` } >
96
- < StyledPolicyIcon />
97
- Dispute Policy
98
- </ StyledInternalLink >
99
- ) }
100
- { isUndefined ( courtId ) ? null : (
101
- < StyledInternalLink to = { `/courts/${ courtId } /policy?section=description` } >
102
- < StyledPolicyIcon />
103
- Court Policy
104
- </ StyledInternalLink >
105
- ) }
106
- </ LinkContainer >
107
- </ ShadeArea >
64
+ < Container >
65
+ < StyledP > Policy documents:</ StyledP >
66
+ { ! isUndefined ( attachment ) && ! isUndefined ( attachment . uri ) ? (
67
+ < StyledInternalLink to = { `attachment/?url=${ getIpfsUrl ( attachment . uri ) } ` } >
68
+ < StyledPaperclipIcon />
69
+ { attachment . label ?? "Attachment" }
70
+ </ StyledInternalLink >
71
+ ) : null }
72
+ { isUndefined ( disputePolicyURI ) ? null : (
73
+ < StyledInternalLink to = { `policy/attachment/?url=${ getIpfsUrl ( disputePolicyURI ) } ` } >
74
+ < StyledPolicyIcon />
75
+ Dispute Policy
76
+ </ StyledInternalLink >
77
+ ) }
78
+ { isUndefined ( courtId ) ? null : (
79
+ < StyledInternalLink to = { `/courts/${ courtId } /policy?section=description` } >
80
+ < StyledPolicyIcon />
81
+ Court Policy
82
+ </ StyledInternalLink >
83
+ ) }
84
+ </ Container >
108
85
) ;
109
86
} ;
0 commit comments