Skip to content

Commit c536d21

Browse files
authored
fix: nps mobile + adjust cookie flex (#1613)
1 parent 1df2925 commit c536d21

File tree

2 files changed

+46
-29
lines changed

2 files changed

+46
-29
lines changed

components/layout/CookieBanner.tsx

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ const CookieBanner = () => {
2323

2424
const consentBoxStyle: React.CSSProperties = {
2525
backgroundColor: theme.palette.secondary.light,
26-
maxWidth: isMobileScreen ? 'none' : theme.spacing(50),
26+
maxWidth: isMobileScreen ? 'none' : theme.spacing(54),
2727
maxHeight: theme.spacing(35),
2828
position: 'fixed',
29-
left: isMobileScreen ? 0 : theme.spacing(2),
29+
right: isMobileScreen ? 0 : theme.spacing(2),
3030
bottom: isMobileScreen
3131
? mobileBottomNavHeight
3232
: isTabletScreen
@@ -36,23 +36,28 @@ const CookieBanner = () => {
3636
boxShadow: `${alpha(theme.palette.common.black, 0.2)} 0px ${theme.spacing(1)} ${theme.spacing(
3737
4,
3838
)} 0px`,
39-
textAlign: 'center',
4039
lineHeight: 1.5,
4140
marginRight: isMobileScreen ? 0 : theme.spacing(2),
42-
padding: isMobileScreen
43-
? `${theme.spacing(3)} ${theme.spacing(2)} `
44-
: `${theme.spacing(2)} ${theme.spacing(4)}`,
41+
padding: `${theme.spacing(3)} ${theme.spacing(2)} `,
4542
zIndex: 5,
4643
};
44+
45+
const rowContainerStyle = {
46+
display: 'flex',
47+
alignItems: 'center',
48+
gap: 2,
49+
} as const;
50+
4751
const acceptButtonStyle = {
4852
backgroundColor: 'secondary.main',
53+
marginLeft: '0.5rem',
4954
float: 'inline-end',
5055
':hover': {
5156
backgroundColor: 'secondary.dark',
5257
},
5358
};
5459
const declineButtonStyle = {
55-
float: 'inline-start',
60+
float: 'inline-end',
5661
fontWeight: 'normal',
5762
color: theme.palette.text.primary,
5863
};
@@ -121,28 +126,30 @@ const CookieBanner = () => {
121126
ariaDeclineLabel={tS('cookieConsent.declineLabel')}
122127
flipButtons={true}
123128
>
124-
<Box width={[50, 70]} margin="auto" mb={1}>
125-
<Image
126-
alt={tS('alt.cookieCat')}
127-
src={IllustrationCookieCat}
128-
sizes={getImageSizes(70)}
129-
style={{
130-
width: '100%',
131-
height: 'auto',
132-
}}
133-
/>
134-
</Box>
135-
<Box mb={2}>
136-
<Typography fontSize={'0.875rem !important'}>
137-
{tS('cookieConsent.cookieConsentExplainer')}
138-
<Link
139-
target="_blank"
140-
href="https://chayn.notion.site/Cookie-Policy-e478b184ea6a4002ba660d052f332c5a"
141-
>
142-
{tS('cookieConsent.cookieConsentPolicy')}
143-
</Link>
144-
.
145-
</Typography>
129+
<Box sx={rowContainerStyle}>
130+
<Box width={50}>
131+
<Image
132+
alt={tS('alt.cookieCat')}
133+
src={IllustrationCookieCat}
134+
sizes={getImageSizes(50)}
135+
style={{
136+
width: '100%',
137+
height: 'auto',
138+
}}
139+
/>
140+
</Box>
141+
<Box mb={2} flex={1}>
142+
<Typography fontSize={'0.875rem !important'}>
143+
{tS('cookieConsent.cookieConsentExplainer')}
144+
<Link
145+
target="_blank"
146+
href="https://chayn.notion.site/Cookie-Policy-e478b184ea6a4002ba660d052f332c5a"
147+
>
148+
{tS('cookieConsent.cookieConsentPolicy')}
149+
</Link>
150+
.
151+
</Typography>
152+
</Box>
146153
</Box>
147154
</CookieConsent>
148155
);

styles/hotjarNPS.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
color: #000000 !important;
1919
}
2020

21+
@media (max-width: 479px) {
22+
._hj-widget-container ._hj-s3UIi__styles__globalStyles .css-1r7qyl6.css-1r7qyl6 * {
23+
bottom: 6.25rem;
24+
height: 2.75rem;
25+
}
26+
}
27+
2128
@media (min-width: 480px) {
2229
._hj-widget-container ._hj-s3UIi__styles__globalStyles .css-1r7qyl6.css-1r7qyl6 * {
2330
bottom: 1.5rem;
@@ -32,6 +39,9 @@
3239
/* Primary button styles */
3340

3441
._hj-widget-container ._hj-s3UIi__styles__globalStyles button[type='button'],
42+
._hj-widget-container
43+
._hj-s3UIi__styles__globalStyles
44+
.css-sm1t49.css-sm1t49.css-sm1t49.css-sm1t49.css-sm1t49.css-sm1t49.css-sm1t49.css-sm1t49.css-sm1t49,
3545
._hj-widget-container
3646
._hj-s3UIi__styles__globalStyles
3747
.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4.css-1ce3vb4,

0 commit comments

Comments
 (0)