Skip to content

Commit 35e0bd5

Browse files
authored
feat: Improve PWA desktop banner + fix tests (#1568)
1 parent eff352c commit 35e0bd5

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

components/banner/DesktopPwaBanner.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { PWA_DESKTOP_BANNER_VIEWED } from '@/lib/constants/events';
44
import { useTypedSelector } from '@/lib/hooks/store';
55
import usePWA from '@/lib/hooks/usePwa';
66
import logEvent, { getEventUserData } from '@/lib/utils/logEvent';
7-
import { rowStyle } from '@/styles/common';
87
import AddBoxOutlinedIcon from '@mui/icons-material/AddBoxOutlined';
98
import IosShareIcon from '@mui/icons-material/IosShare';
109
import { Button, Paper, Stack, Typography, useMediaQuery, useTheme } from '@mui/material';
@@ -36,29 +35,23 @@ export const DesktopPwaBanner = () => {
3635
if (isSmallScreen || bannerState === 'Hidden') return null;
3736

3837
const bannerStyle = {
39-
...rowStyle,
4038
position: 'fixed',
4139
zIndex: 1000,
42-
px: 2,
43-
py: 1.5,
44-
maxWidth: { md: 720, lg: 800 },
45-
minWidth: { md: 640, lg: 800 },
46-
top: { md: 150, lg: 160 },
47-
alignItems: 'center',
48-
gap: 2,
49-
justifyContent: bannerState === 'Generic' ? 'space-between' : 'flex-start',
40+
p: 2.5,
41+
width: 250,
42+
right: { md: 16, lg: 80 },
43+
bottom: { md: 16, lg: 40 },
5044
backgroundColor: 'common.white',
51-
width: 'auto',
5245
} as const;
5346

5447
return (
5548
<Paper elevation={1} sx={bannerStyle}>
56-
<Typography variant="body2" sx={{ fontWeight: 500, whiteSpace: 'nowrap' }}>
49+
<Typography variant="body2" fontWeight={500}>
5750
{t(bannerState === 'Generic' ? 'mobileDescription' : 'iosDescription')}
5851
</Typography>
5952

6053
{bannerState === 'Generic' ? (
61-
<Stack direction="row" spacing={1}>
54+
<Stack direction="row" spacing={1} mt={1.5} ml="auto">
6255
<Button
6356
onClick={declineInstallation}
6457
variant="outlined"

components/forms/ProfileSettingsForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ const ProfileSettingsForm = () => {
121121
loading={isLoading}
122122
color="secondary"
123123
type="submit"
124-
endIcon={isSuccess ? <CheckCircleOutlined /> : undefined}
124+
endIcon={
125+
isSuccess ? <CheckCircleOutlined data-testid="CheckCircleOutlinedIcon" /> : undefined
126+
}
125127
disabled={isSuccess || !diffExists}
126128
>
127129
{t('profileSettings.submitLabel')}

components/storyblok/StoryblokTeamMemberCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const StoryblokTeamMemberCard = (props: StoryblokTeamMemberCardProps) => {
184184
</Typography>
185185
{!hide_languages && (
186186
<Box sx={iconRowStyles}>
187-
<LanguageIcon color="error" sx={iconStyles} />
187+
<LanguageIcon data-testid="LanguageIcon" color="error" sx={iconStyles} />
188188
<Typography variant="body2" ml={0}>
189189
{languages}
190190
</Typography>

0 commit comments

Comments
 (0)