@@ -13,15 +13,8 @@ import { mediumAndUp, largeAndUp } from "../../theme/mediaQueries";
13
13
14
14
const variants = [ "standard" , "withLink" ] ;
15
15
16
- const ListContainer = styled . div `
17
- padding: ${ spacing . moderate } 0
18
- ${ props => ( props . variant === "withLink" ? spacing . cozy : "12px" ) } 12px;
16
+ const RowContainer = styled . div `
19
17
background-color: ${ colors . white . base } ;
20
- ${ mediumAndUp `
21
- padding: 18px 0
22
- ${ props => ( props . variant === "withLink" ? spacing . cozy : "18px" ) }
23
- 12px;
24
- ` } ;
25
18
26
19
&:not(:last-of-type) {
27
20
border-bottom: 1px solid ${ colors . lightGray } ;
@@ -60,21 +53,45 @@ const LinkWrapper = styled.a`
60
53
text-decoration: none;
61
54
display: block;
62
55
width: 100%;
56
+ cursor: pointer;
57
+ padding-top: ${ spacing . cozy } ;
58
+ padding-bottom: ${ spacing . cozy } ;
59
+ margin: 12px 0
60
+ ${ props => ( props . variant === "withLink" ? spacing . cozy : "12px" ) } 0;
61
+ ${ mediumAndUp `
62
+ margin: 18px 0
63
+ ${ props => ( props . variant === "withLink" ? spacing . cozy : "18px" ) }
64
+ 0;
65
+ ` } ;
66
+ &:hover {
67
+ background: ${ colors . azure . muted } ;
68
+ }
63
69
` ;
64
70
65
- const ClickableButton = styled . span `
71
+ const ClickableButton = styled . button `
66
72
background: none;
67
73
border: none;
68
- padding: 0;
69
74
cursor: pointer;
70
- width: 100% ;
75
+ display: block ;
71
76
text-align: start;
77
+ padding: 14px 0
78
+ ${ props => ( props . variant === "withLink" ? spacing . cozy : "14px" ) } 0;
72
79
` ;
73
80
74
81
const ListRowButton = StyledButton . withComponent ( "span" ) . extend `
75
82
display: flex;
76
83
justify-content: center;
77
84
align-items: center;
85
+ padding: 18px 0
86
+ ${ props => ( props . variant === "withLink" ? spacing . cozy : "18px" ) }
87
+ 0;
88
+ ` ;
89
+
90
+ const LinkRow = styled ( Row ) `
91
+ padding-left: ${ spacing . cozy } ;
92
+ ${ mediumAndUp `
93
+ padding-left: 12px;
94
+ ` } ;
78
95
` ;
79
96
80
97
const ListItem = ( {
@@ -90,79 +107,86 @@ const ListItem = ({
90
107
linkSubTitle,
91
108
coloredDate,
92
109
onClick,
93
- onOverflowClick,
94
- isLast
110
+ onOverflowClick
95
111
} ) => (
96
- < ListContainer isLast = { isLast } variant = { variant } onExpand = { onClick } >
97
- < LinkWrapper onClick = { onClick } href = { href } >
98
- < ListRow >
99
- < Column small = { 3 } medium = { 1.8 } large = { 1.3 } xLarge = { 1 } >
100
- < BoldText
101
- style = { { textTransform : "uppercase" } }
102
- color = { coloredDate ? colors . heliotrope . base : null }
103
- >
104
- { dateTitle }
105
- </ BoldText >
106
- < SecondaryText > { dateSubTitle } </ SecondaryText >
107
- </ Column >
108
-
109
- < MobileOnlyColumn small = { 8 } >
110
- < Column medium = { 4 } large = { 3 } >
111
- < PrimaryText > { title } </ PrimaryText >
112
- </ Column >
113
- < Column >
114
- < SecondaryText > { subTitle } </ SecondaryText >
115
- </ Column >
116
- </ MobileOnlyColumn >
117
-
118
- < DesktopOnlyColumn medium = { 8 } large = { 4.5 } xLarge = { 4.9 } >
119
- < PrimaryText > { title } </ PrimaryText >
120
- </ DesktopOnlyColumn >
121
- < SubTitleColumn large = { 4.5 } xLarge = { 4.9 } >
122
- < PrimaryText > { subTitle } </ PrimaryText >
123
- </ SubTitleColumn >
124
-
125
- < DesktopOnlyColumn medium = { 2 } large = { 1.6 } xLarge = { 1.1 } >
126
- < ListRowButton
127
- aria-label = { buttonText }
128
- role = "button"
129
- width = "102px"
130
- variant = "standard"
131
- >
132
- { buttonText }
133
- </ ListRowButton >
134
- </ DesktopOnlyColumn >
135
-
136
- < MobileOnlyColumn small = { 1 } >
137
- < ClickableButton onClick = { onOverflowClick } >
138
- < OverflowIcon
139
- size = { 22 }
140
- color = { colors . onyx . light }
141
- onClick = { onOverflowClick }
142
- />
143
- </ ClickableButton >
144
- </ MobileOnlyColumn >
145
- </ ListRow >
146
- </ LinkWrapper >
112
+ < RowContainer variant = { variant } onExpand = { onClick } >
113
+ < ListRow >
114
+ < Column small = { 10.6 } medium = { 9.8 } large = { 10.2 } xLarge = { 10.8 } >
115
+ < LinkWrapper onClick = { onClick } href = { href } >
116
+ < Row >
117
+ < Column small = { 3.8 } medium = { 2.1 } large = { 1.5 } xLarge = { 1 } >
118
+ < BoldText
119
+ style = { { textTransform : "uppercase" } }
120
+ color = { coloredDate ? colors . heliotrope . base : null }
121
+ >
122
+ { dateTitle }
123
+ </ BoldText >
124
+ < SecondaryText > { dateSubTitle } </ SecondaryText >
125
+ </ Column >
126
+
127
+ < MobileOnlyColumn small = { 7 } >
128
+ < Column medium = { 4 } large = { 3 } >
129
+ < PrimaryText > { title } </ PrimaryText >
130
+ </ Column >
131
+ < Column >
132
+ < SecondaryText > { subTitle } </ SecondaryText >
133
+ </ Column >
134
+ </ MobileOnlyColumn >
135
+
136
+ < DesktopOnlyColumn medium = { 8 } large = { 4.5 } xLarge = { 4.9 } >
137
+ < PrimaryText > { title } </ PrimaryText >
138
+ </ DesktopOnlyColumn >
139
+ < SubTitleColumn large = { 4.5 } xLarge = { 4.9 } >
140
+ < PrimaryText > { subTitle } </ PrimaryText >
141
+ </ SubTitleColumn >
142
+ </ Row >
143
+ </ LinkWrapper >
144
+ </ Column >
145
+
146
+ < DesktopOnlyColumn medium = { 2 } large = { 1.6 } xLarge = { 1.1 } >
147
+ < ListRowButton
148
+ aria-label = { buttonText }
149
+ role = "button"
150
+ width = "102px"
151
+ variant = "standard"
152
+ >
153
+ { buttonText }
154
+ </ ListRowButton >
155
+ </ DesktopOnlyColumn >
156
+
157
+ < MobileOnlyColumn small = { 1.4 } >
158
+ < ClickableButton
159
+ onClick = { onOverflowClick }
160
+ aria-label = "More Info"
161
+ role = "button"
162
+ >
163
+ < OverflowIcon
164
+ size = { 22 }
165
+ // style={{ paddingTop: "5px", paddingBottom: "5px" }}
166
+ color = { colors . onyx . light }
167
+ onClick = { onOverflowClick }
168
+ />
169
+ </ ClickableButton >
170
+ </ MobileOnlyColumn >
171
+ </ ListRow >
147
172
{ variant === "withLink" ? (
148
- < Row >
173
+ < LinkRow >
149
174
< Column small = { 9 } medium = { 10 } large = { 10.5 } xLarge = { 10.8 } >
150
175
< Link href = { linkUrl } > { linkTitle } </ Link >
151
176
</ Column >
152
177
< Column small = { 3 } medium = { 2 } large = { 1.5 } xLarge = { 1.2 } >
153
178
< SecondaryText > { linkSubTitle } </ SecondaryText >
154
179
</ Column >
155
- </ Row >
180
+ </ LinkRow >
156
181
) : null }
157
- </ ListContainer >
182
+ </ RowContainer >
158
183
) ;
159
184
160
185
ListItem . defaultProps = {
161
186
linkTitle : "" ,
162
187
linkUrl : "" ,
163
188
linkSubTitle : "" ,
164
- coloredDate : false ,
165
- isLast : false
189
+ coloredDate : false
166
190
} ;
167
191
168
192
ListItem . propTypes = {
@@ -178,8 +202,7 @@ ListItem.propTypes = {
178
202
linkSubTitle : PropTypes . string ,
179
203
coloredDate : PropTypes . bool ,
180
204
onClick : PropTypes . func . isRequired ,
181
- onOverflowClick : PropTypes . func . isRequired ,
182
- isLast : PropTypes . bool
205
+ onOverflowClick : PropTypes . func . isRequired
183
206
} ;
184
207
185
208
export default ListItem ;
0 commit comments