Skip to content

Commit a6f92b6

Browse files
committed
Update pagination button styles
1 parent 99bd854 commit a6f92b6

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

src/components/button.js

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,18 @@ const ButtonStyles = css.global`
4141
.button.primary {
4242
color: #ffffff;
4343
background: ${theme.colors.primaryColor};
44-
border: none;
44+
border: 2px solid transparent;
4545
box-shadow: 2px 2px #ffffff, 4px 4px ${theme.colors.primaryColor};
4646
}
47+
.button.secondary {
48+
color: ${theme.colors.primaryColor};
49+
background: ${theme.colors.primaryLite};
50+
box-shadow: 2px 2px #ffffff, 4px 4px ${theme.colors.primaryColor};
51+
}
52+
.button.flat {
53+
box-shadow: none;
54+
position: relative;
55+
}
4756
4857
/* Button size modifiers
4958
========================================================================== */
@@ -145,6 +154,7 @@ export default function Button({
145154
}) {
146155
let classes = [`button`, variant, className]
147156
if (disabled) classes.push('disabled')
157+
if (flat) classes.push('flat')
148158
let classNames = classes.join(' ')
149159
if (type === 'submit') {
150160
return (
@@ -162,16 +172,16 @@ export default function Button({
162172
<style jsx>{ButtonStyles}</style>
163173
<style jsx>{`
164174
.button {
165-
box-shadow: ${flat && 'none'};
166-
position: relative;
175+
min-width: 1.75rem;
176+
min-height: 1.75rem;
167177
}
168178
.button::after {
169179
content: '';
170-
position: absolute;
180+
position: ${useIcon && 'absolute'};
171181
top: 0;
172182
left: 0;
173-
width: 100%;
174-
height: 100%;
183+
width: ${useIcon && '100%'};
184+
height: ${useIcon && '100%'};
175185
mask: ${useIcon
176186
? `url(${join(URL, `/static/icon-${useIcon}.svg`)})`
177187
: 'none'};
@@ -199,16 +209,16 @@ export default function Button({
199209
<style jsx>{ButtonStyles}</style>
200210
<style jsx>{`
201211
.button {
202-
box-shadow: ${flat && 'none'};
203-
position: relative;
212+
min-width: 1.75rem;
213+
min-height: 1.75rem;
204214
}
205215
.button::after {
206216
content: '';
207-
position: absolute;
217+
position: ${useIcon && 'absolute'};
208218
top: 0;
209219
left: 0;
210-
width: 100%;
211-
height: 100%;
220+
width: ${useIcon && '100%'};
221+
height: ${useIcon && '100%'};
212222
mask: ${useIcon
213223
? `url(${join(URL, `/static/icon-${useIcon}.svg`)})`
214224
: 'none'};
@@ -234,18 +244,16 @@ export default function Button({
234244
<style jsx>{ButtonStyles}</style>
235245
<style jsx>{`
236246
.button {
237-
box-shadow: ${flat && 'none'};
238-
position: relative;
239247
min-width: 1.75rem;
240248
min-height: 1.75rem;
241249
}
242250
.button::after {
243251
content: '';
244-
position: absolute;
252+
position: ${useIcon && 'absolute'};
245253
top: 0;
246254
left: 0;
247-
width: 100%;
248-
height: 100%;
255+
width: ${useIcon && '100%'};
256+
height: ${useIcon && '100%'};
249257
mask: ${useIcon
250258
? `url(${join(URL, `/static/icon-${useIcon}.svg`)})`
251259
: 'none'};

src/components/pagination.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function Pagination({ pagination, setPage, 'data-cy': dataCy }) {
7575
onClick={() => setPage(page)}
7676
key={`page-${page}`}
7777
disabled={page === '...'}
78+
variant={currentPage === page ? 'primary' : 'secondary'}
7879
data-cy={`page-${page}-button`}
7980
className='small'
8081
flat

0 commit comments

Comments
 (0)