Skip to content

Commit a82fad9

Browse files
committed
Update Cookie Consent to work on mobile
1 parent 0fc8465 commit a82fad9

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

client/modules/User/components/CookieConsent.jsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ReactGA from 'react-ga';
66
import { Transition } from 'react-transition-group';
77
import getConfig from '../../../utils/getConfig';
88
import { setUserCookieConsent } from '../actions';
9-
import { remSize, prop } from '../../../theme';
9+
import { remSize, prop, device } from '../../../theme';
1010
import Button from '../../../common/Button';
1111

1212
const CookieConsentContainer = styled.div`
@@ -16,7 +16,7 @@ const CookieConsentContainer = styled.div`
1616
if (state === 'entered') {
1717
return '0';
1818
}
19-
return remSize(-200);
19+
return remSize(-300);
2020
}};
2121
left: 0;
2222
right: 0;
@@ -29,7 +29,10 @@ const CookieConsentDialog = styled.div`
2929
background: ${prop('Modal.background')};
3030
color: ${prop('primaryTextColor')};
3131
border-top: 1px solid ${prop('Separator')};
32-
padding: ${remSize(40)} ${remSize(60)};
32+
padding: ${remSize(20)} ${remSize(30)};
33+
@media ${device.desktop} {
34+
padding: ${remSize(40)} ${remSize(60)};
35+
}
3336
`;
3437

3538
const CookieConsentHeader = styled.h2`
@@ -39,19 +42,29 @@ const CookieConsentHeader = styled.h2`
3942
const CookieConsentContent = styled.div`
4043
display: flex;
4144
justify-content: space-between;
45+
flex-direction: column;
46+
@media ${device.desktop} {
47+
flex-direction: row;
48+
}
4249
`;
4350

4451
const CookieConsentCopy = styled.p`
4552
line-height: 1.5em;
53+
margin-bottom: ${remSize(20)};
54+
@media ${device.desktop} {
55+
margin-bottom: 0;
56+
}
4657
`;
4758

4859
const CookieConsentButtons = styled.div`
4960
display: flex;
5061
align-items: center;
51-
margin-left: ${remSize(60)};
5262
& button:not(:last-child) {
5363
margin-right: ${remSize(20)};
5464
}
65+
@media ${device.desktop} {
66+
margin-left: ${remSize(60)};
67+
}
5568
`;
5669

5770
function CookieConsent() {

client/theme.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export const common = {
4747
shadowColor: 'rgba(0, 0, 0, 0.16)'
4848
};
4949

50+
export const device = {
51+
desktop: `(min-width: 770px)`
52+
};
53+
5054
export const remSize = (size) => `${size / common.baseFontSize}rem`;
5155

5256
export const prop = (key) => (props) => {

0 commit comments

Comments
 (0)