Skip to content

Commit fe50c4b

Browse files
committed
welcome screen
1 parent 0eeb76c commit fe50c4b

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

frontend/submission/components/forms/WelcomeStep.tsx

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import {CheckCircle, Info} from '@mui/icons-material'
2-
import {Box, Divider, Paper} from '@mui/material'
1+
import { EmojiPeople, Info} from '@mui/icons-material'
2+
import {Box, Divider, Paper, useTheme} from '@mui/material'
33
import {blue, green, grey} from '@mui/material/colors'
44
import React, {useState} from 'react'
55
import {useTranslation} from 'react-i18next'
6+
import rehypeSanitize from 'rehype-sanitize'
67

78
import {useIs_TranslatorQuery} from '../../api/generates'
89
import {resources} from '../../i18n'
910
import {useSubmittedStore,useTokenStore} from '../../state'
11+
import AlertBox from '../layout/AlertBox'
12+
import {MDEditorMarkdown} from '../renderer/MDEditor'
1013
import FormTranslationHelper from './FormTranslationHelper'
1114

1215
const WelcomeStep = () => {
@@ -22,6 +25,7 @@ const WelcomeStep = () => {
2225

2326
const [commonTranslation, setCommonTranslation] = useState((resources as any)[language]?.common || resources.en.common)
2427

28+
const theme = useTheme()
2529
return <Box
2630
style={{minHeight: '50vh'}}
2731
display='flex'
@@ -30,13 +34,16 @@ const WelcomeStep = () => {
3034
justifyContent={'center'}
3135
>
3236

33-
<Paper elevation={3} sx={{backgroundColor: grey[100]}}>
34-
<Box display={'flex'} flexDirection={'row'} justifyContent='center'>
35-
<Box textAlign='center' sx={{backgroundColor: !submitted ? blue[500] : green[500], width: '100%', padding: '1em'}}>
36-
{t('welcome_step')}
37-
</Box>
38-
</Box>
39-
</Paper>
37+
<AlertBox title={t('welcome_step_title')}
38+
description={t('welcome_step_description')}
39+
color={theme.palette.info.light}
40+
icon={EmojiPeople}>
41+
<Box display={'flex'} flexDirection={'row'} justifyContent='center'>
42+
<MDEditorMarkdown
43+
source={t('welcome_step_content')}
44+
rehypePlugins={[[rehypeSanitize]]}/>
45+
</Box>
46+
</AlertBox>
4047
{enableTranslationHelper && <>
4148
<Divider style={{marginTop: '2em', marginBottom: '2em'}}/>
4249
<FormTranslationHelper
@@ -45,7 +52,8 @@ const WelcomeStep = () => {
4552
language={language}
4653
translationData={commonTranslation}
4754
onTranslationChange={({data}) => setCommonTranslation( data)}
48-
/></>}
55+
/>
56+
</>}
4957

5058
</Box>
5159
}

frontend/submission/i18n/de.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
"invalid_token": "Ungültige Zugangschiffre",
1111
"missing_token": "Fehlende Zugangschiffre",
1212
"enter_valid_token": "Bitte gültigen Zugangschiffre eingeben",
13-
"welcome_step": "Willkommen!",
13+
"welcome_step_title": "Willkommen!",
14+
"welcome_step_description": "Es folgt eine kleine Einführung in das Formular",
15+
"welcome_step_content": "Ein Willkommenstext Einfuehrung mit **Formatierung**",
1416
"success_submit": "Erfolgreich übermittelt",
1517
"success_received": "Wir haben die Daten erhalten und werden uns in Kürze um deren Bearbeitung kümmern",
1618
"almost_done": "Fast geschafft...",

frontend/submission/i18n/en.json

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"submit": "submit",
88
"submitted": "submitted",
99
"delete": "delete",
10+
"welcome_step_title": "Welcome!",
11+
"welcome_step_description": "In the following you will be given a short introduction",
12+
"welcome_step_content": "Ein Willkommenstext Einfuehrung mit **Formatierung**",
1013
"invalid_token": "invalid token",
1114
"missing_token": "missing token",
1215
"enter_valid_token": "please enter a valid token ",

0 commit comments

Comments
 (0)