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'
3
3
import { blue , green , grey } from '@mui/material/colors'
4
4
import React , { useState } from 'react'
5
5
import { useTranslation } from 'react-i18next'
6
+ import rehypeSanitize from 'rehype-sanitize'
6
7
7
8
import { useIs_TranslatorQuery } from '../../api/generates'
8
9
import { resources } from '../../i18n'
9
10
import { useSubmittedStore , useTokenStore } from '../../state'
11
+ import AlertBox from '../layout/AlertBox'
12
+ import { MDEditorMarkdown } from '../renderer/MDEditor'
10
13
import FormTranslationHelper from './FormTranslationHelper'
11
14
12
15
const WelcomeStep = ( ) => {
@@ -22,6 +25,7 @@ const WelcomeStep = () => {
22
25
23
26
const [ commonTranslation , setCommonTranslation ] = useState ( ( resources as any ) [ language ] ?. common || resources . en . common )
24
27
28
+ const theme = useTheme ( )
25
29
return < Box
26
30
style = { { minHeight : '50vh' } }
27
31
display = 'flex'
@@ -30,13 +34,16 @@ const WelcomeStep = () => {
30
34
justifyContent = { 'center' }
31
35
>
32
36
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 >
40
47
{ enableTranslationHelper && < >
41
48
< Divider style = { { marginTop : '2em' , marginBottom : '2em' } } />
42
49
< FormTranslationHelper
@@ -45,7 +52,8 @@ const WelcomeStep = () => {
45
52
language = { language }
46
53
translationData = { commonTranslation }
47
54
onTranslationChange = { ( { data} ) => setCommonTranslation ( data ) }
48
- /> </ > }
55
+ />
56
+ </ > }
49
57
50
58
</ Box >
51
59
}
0 commit comments