@@ -8,6 +8,40 @@ import { UserPreferencesSchema } from '../../../shared/user'
8
8
import { useSnackbar } from 'notistack'
9
9
import { useState } from 'react'
10
10
11
+ export const ShiftEnterToSend = ( { t } ) => (
12
+ < Box display = "flex" alignItems = "center" gap = { 0.5 } >
13
+ < strong > { t ( 'sendPreferenceConfigurator:shift' ) } </ strong >
14
+ < ArrowUpward fontSize = "small" /> + < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
15
+ < KeyboardReturn fontSize = "small" />
16
+ { t ( 'sendPreferenceConfigurator:toSend' ) }
17
+ </ Box >
18
+ )
19
+
20
+ export const EnterToSend = ( { t } ) => (
21
+ < Box display = "flex" alignItems = "center" gap = { 0.5 } >
22
+ < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
23
+ < KeyboardReturn fontSize = "small" />
24
+ { t ( 'sendPreferenceConfigurator:toSend' ) }
25
+ </ Box >
26
+ )
27
+
28
+ export const ShiftEnterForNewline = ( { t } ) => (
29
+ < Box display = "flex" alignItems = "center" gap = { 0.5 } >
30
+ < strong > { t ( 'sendPreferenceConfigurator:shift' ) } </ strong >
31
+ < ArrowUpward fontSize = "small" /> + < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
32
+ < KeyboardReturn fontSize = "small" />
33
+ { t ( 'sendPreferenceConfigurator:toNewline' ) }
34
+ </ Box >
35
+ )
36
+
37
+ export const EnterForNewline = ( { t } ) => (
38
+ < Box display = "flex" alignItems = "center" gap = { 0.5 } >
39
+ < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
40
+ < KeyboardReturn fontSize = "small" />
41
+ { t ( 'sendPreferenceConfigurator:toNewline' ) }
42
+ </ Box >
43
+ )
44
+
11
45
export const SendPreferenceConfiguratorModal = ( { open, onClose, anchorEl, context } ) => {
12
46
const { user } = useCurrentUser ( )
13
47
const preferenceUpdate = usePreferencesUpdateMutation ( )
@@ -68,42 +102,24 @@ export const SendPreferenceConfiguratorModal = ({ open, onClose, anchorEl, conte
68
102
< Typography > { t ( 'sendPreferenceConfigurator:title' ) } </ Typography >
69
103
< RadioGroup value = { value } onChange = { handleChange } name = "sendPreferenceConfigurator" >
70
104
< FormControlLabel
71
- sx = { { my : 2 } }
105
+ sx = { { my : 2 , fontSize : 'small' } }
72
106
value = "shift+enter"
73
107
control = { < Radio /> }
74
108
label = {
75
109
< div >
76
- < Box display = "flex" alignItems = "center" gap = { 1 } >
77
- < strong > { t ( 'sendPreferenceConfigurator:shift' ) } </ strong >
78
- < ArrowUpward fontSize = "small" /> + < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
79
- < KeyboardReturn fontSize = "small" />
80
- { t ( 'sendPreferenceConfigurator:toSend' ) }
81
- </ Box >
82
- < Box display = "flex" alignItems = "center" gap = { 1 } >
83
- < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
84
- < KeyboardReturn fontSize = "small" />
85
- { t ( 'sendPreferenceConfigurator:toAddNewline' ) }
86
- </ Box >
110
+ < ShiftEnterToSend t = { t } />
111
+ < EnterForNewline t = { t } />
87
112
</ div >
88
113
}
89
114
/>
90
115
< FormControlLabel
91
- sx = { { mb : 2 } }
116
+ sx = { { mb : 2 , fontSize : 'small' } }
92
117
value = "enter"
93
118
control = { < Radio /> }
94
119
label = {
95
120
< div >
96
- < Box display = "flex" alignItems = "center" gap = { 1 } >
97
- < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
98
- < KeyboardReturn fontSize = "small" />
99
- { t ( 'sendPreferenceConfigurator:toSend' ) }
100
- </ Box >
101
- < Box display = "flex" alignItems = "center" gap = { 1 } >
102
- < strong > { t ( 'sendPreferenceConfigurator:shift' ) } </ strong >
103
- < ArrowUpward fontSize = "small" /> + < strong > { t ( 'sendPreferenceConfigurator:return' ) } </ strong >
104
- < KeyboardReturn fontSize = "small" />
105
- { t ( 'sendPreferenceConfigurator:toAddNewline' ) }
106
- </ Box >
121
+ < EnterToSend t = { t } />
122
+ < ShiftEnterForNewline t = { t } />
107
123
</ div >
108
124
}
109
125
/>
0 commit comments