Skip to content

Commit 73134bd

Browse files
committed
Modify published general notification semantics
1 parent de998e6 commit 73134bd

File tree

5 files changed

+72
-59
lines changed

5 files changed

+72
-59
lines changed

client/src/components/SurveyLandingPage.tsx

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -135,60 +135,62 @@ export default function SurveyLandingPage({
135135
alt={tr.IconAltTexts.logoAltText}
136136
/>
137137
</Box>
138-
<PublishedGeneralNotification
139-
isMobile={mediumWidth}
140-
defaultOpen
141-
variant={'external'}
142-
sx={{
143-
minWidth: mediumWidth ? 'auto' : '500px',
144-
maxWidth: '800px',
145-
alignSelf: 'center',
146-
...(notificationWidth && {
147-
borderRadius: 0,
148-
borderRight: 0,
149-
borderLeft: 0,
150-
}),
151-
}}
152-
/>
153-
<Box
154-
className="middle-content"
155-
sx={{
156-
display: 'flex',
157-
flexDirection: 'column',
158-
alignItems: 'center',
159-
justifyContent: 'center',
160-
}}
161-
>
162-
<div>
163-
<Box
164-
component="h1"
165-
sx={(theme) => ({
166-
...styles(theme).heading,
167-
...styles(theme).title,
168-
})}
169-
>
170-
<span>{survey.title?.[surveyLanguage]}</span>
171-
</Box>
172-
{survey.subtitle?.[surveyLanguage] && (
138+
<Stack gap={0} flexDirection={'column-reverse'}>
139+
<Box
140+
className="middle-content"
141+
sx={{
142+
display: 'flex',
143+
flexDirection: 'column',
144+
alignItems: 'center',
145+
justifyContent: 'center',
146+
}}
147+
>
148+
<div>
173149
<Box
174-
component="h2"
150+
component="h1"
175151
sx={(theme) => ({
176152
...styles(theme).heading,
177-
...styles(theme).subtitle,
153+
...styles(theme).title,
178154
})}
179155
>
180-
<span>{survey.subtitle?.[surveyLanguage]}</span>
156+
<span>{survey.title?.[surveyLanguage]}</span>
181157
</Box>
182-
)}
183-
</div>
184-
<Button onClick={onStart}>
185-
<Typography variant="body1" sx={(theme) => styles(theme).start}>
186-
{continueUnfinished
187-
? tr.SurveyPage.continueSurveyLink
188-
: tr.SurveyPage.startSurveyLink}
189-
</Typography>
190-
</Button>
191-
</Box>
158+
{survey.subtitle?.[surveyLanguage] && (
159+
<Box
160+
component="h2"
161+
sx={(theme) => ({
162+
...styles(theme).heading,
163+
...styles(theme).subtitle,
164+
})}
165+
>
166+
<span>{survey.subtitle?.[surveyLanguage]}</span>
167+
</Box>
168+
)}
169+
</div>
170+
<Button onClick={onStart}>
171+
<Typography variant="body1" sx={(theme) => styles(theme).start}>
172+
{continueUnfinished
173+
? tr.SurveyPage.continueSurveyLink
174+
: tr.SurveyPage.startSurveyLink}
175+
</Typography>
176+
</Button>
177+
</Box>
178+
<PublishedGeneralNotification
179+
isMobile={mediumWidth}
180+
defaultOpen
181+
variant={'external'}
182+
sx={{
183+
minWidth: mediumWidth ? 'auto' : '500px',
184+
maxWidth: '800px',
185+
alignSelf: 'center',
186+
...(notificationWidth && {
187+
borderRadius: 0,
188+
borderRight: 0,
189+
borderLeft: 0,
190+
}),
191+
}}
192+
/>
193+
</Stack>
192194
<Box
193195
className="footer-content"
194196
sx={{

client/src/components/admin/GeneralNotification/GeneralNotificationCard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { CssBaseline } from '@mui/material';
12
import Image from '@tiptap/extension-image';
23
import { Markdown } from '@tiptap/markdown';
34
import { EditorContent, useEditor } from '@tiptap/react';
45
import StarterKit from '@tiptap/starter-kit';
56
import React, { useEffect } from 'react';
7+
import '../TextEditor/styles.css';
68

79
interface Props {
810
content: string;
@@ -33,5 +35,9 @@ export function GeneralNotificationCard({ content }: Props) {
3335
if (!editor) {
3436
return null;
3537
}
36-
return <EditorContent editor={editor} />;
38+
return (
39+
<CssBaseline>
40+
<EditorContent editor={editor} />
41+
</CssBaseline>
42+
);
3743
}

client/src/components/admin/GeneralNotification/PublishedGeneralNotification.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import React, { Fragment, useEffect, useRef, useState } from 'react';
21
import { GeneralNotification } from '@interfaces/generalNotification';
3-
import { request } from '@src/utils/request';
4-
import { GeneralNotificationCard } from './GeneralNotificationCard';
5-
import { useToasts } from '@src/stores/ToastContext';
6-
import { useTranslations } from '@src/stores/TranslationContext';
2+
import { Campaign, ExpandLess, ExpandMore } from '@mui/icons-material';
73
import {
84
CardActionArea,
95
Stack,
106
SxProps,
117
Typography,
128
useTheme,
139
} from '@mui/material';
14-
import { Campaign, ExpandLess, ExpandMore } from '@mui/icons-material';
10+
import { useToasts } from '@src/stores/ToastContext';
11+
import { useTranslations } from '@src/stores/TranslationContext';
12+
import { request } from '@src/utils/request';
13+
import React, { Fragment, useEffect, useRef, useState } from 'react';
14+
15+
import { GeneralNotificationCard } from './GeneralNotificationCard';
1516

1617
interface Props {
1718
variant: 'internal' | 'external';
@@ -147,7 +148,11 @@ export function PublishedGeneralNotification({
147148
>
148149
{notifications.map((notification) => (
149150
<Fragment key={notification.id}>
150-
<Typography variant="h6" sx={{ marginTop: '1rem' }}>
151+
<Typography
152+
variant="h6"
153+
component={'h2'}
154+
sx={{ marginTop: '1rem' }}
155+
>
151156
{
152157
notification.title[
153158
variant === 'internal' ? language : surveyLanguage

client/src/components/admin/TextEditor/MenuBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ export function MenuBar({
185185
borderTopLeftRadius: '4px',
186186
}}
187187
disableTouchRipple
188-
onClick={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}
189-
className={editor.isActive('heading', { level: 2 }) ? 'is-active' : ''}
188+
onClick={() => editor.chain().focus().toggleHeading({ level: 3 }).run()}
189+
className={editor.isActive('heading', { level: 3 }) ? 'is-active' : ''}
190190
>
191191
{tr.TextEditor.headerTitle}
192192
</Button>

client/src/components/admin/TextEditor/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
font-weight: 400;
1414
line-height: 1.18;
1515
}
16-
h2 {
16+
h3 {
1717
color: var(--primary-main);
1818
font-size: 1.125rem;
1919
font-weight: 700;

0 commit comments

Comments
 (0)