|
11 | 11 | limitations under the License. |
12 | 12 | */ |
13 | 13 | import { useNavigate } from "react-router"; |
14 | | -import { Dialog, DialogContent, Button, Tabs, Tab, Box, TextField } from '@mui/material'; |
| 14 | +import { Dialog, DialogContent, Button, Tabs, Tab, Box, TextField, type SelectChangeEvent, FormControl, InputLabel, Select, MenuItem } from '@mui/material'; |
15 | 15 | import * as React from 'react'; |
16 | 16 | import {useState} from 'react'; |
17 | 17 | import GlobalState, { type UserDataState } from "~/GlobalState"; |
@@ -152,8 +152,13 @@ export function Login() { |
152 | 152 | }; |
153 | 153 | } |
154 | 154 |
|
| 155 | + const [language, setLanguage] = React.useState('en'); |
| 156 | + const handleLanguageChange = (event: SelectChangeEvent) => { |
| 157 | + setLanguage(event.target.value); |
| 158 | + }; |
| 159 | + |
155 | 160 | return (<Dialog open={globalLoginModal} onClose={handleClose} className="backDrop"> |
156 | | - <DialogContent> |
| 161 | + <DialogContent className={styles.content}> |
157 | 162 | <Tabs value={activeTab} onChange={handleTabChange} aria-label="basic tabs example"> |
158 | 163 | <Tab label={t('login.login')} {...a11yProps(0)} /> |
159 | 164 | <Tab label={t('login.signin')} {...a11yProps(1)} /> |
@@ -187,10 +192,25 @@ export function Login() { |
187 | 192 | fullWidth |
188 | 193 | variant="standard" |
189 | 194 | /> |
190 | | - <div> |
| 195 | + <div className="flex justify-between items-center mt-4"> |
| 196 | + <div> |
191 | 197 | <Button type="submit">{t('common.ok')}</Button> |
192 | 198 | <Button onClick={handleCancel}>{t('common.cancel')}</Button> |
193 | | - </div> |
| 199 | + </div> |
| 200 | + <FormControl sx={{ minWidth: 120 }} size="small"> |
| 201 | + <InputLabel id="demo-select-small-label">{t('common.language')}</InputLabel> |
| 202 | + <Select |
| 203 | + labelId="demo-select-small-label" |
| 204 | + id="demo-select-small" |
| 205 | + value={language} |
| 206 | + label={t('common.language')} |
| 207 | + onChange={handleLanguageChange} |
| 208 | + > |
| 209 | + <MenuItem value={'en'}>{t('common.english')}</MenuItem> |
| 210 | + <MenuItem value={'de'}>{t('common.german')}</MenuItem> |
| 211 | + </Select> |
| 212 | + </FormControl> |
| 213 | + </div> |
194 | 214 | <div className={styles.responseMsg}> |
195 | 215 | {[responseMsg].filter(value => !!value).map((value, index) => |
196 | 216 | <span key={index}>{t('common.message')}: {value}</span> |
@@ -238,9 +258,25 @@ export function Login() { |
238 | 258 | fullWidth |
239 | 259 | variant="standard" |
240 | 260 | /> |
241 | | - <div> |
| 261 | + <div className="flex justify-between items-center mt-4"> |
| 262 | + <div> |
242 | 263 | <Button type="submit">{t('common.ok')}</Button> |
243 | 264 | <Button onClick={handleCancel}>{t('common.cancel')}</Button> |
| 265 | + </div> |
| 266 | + <FormControl sx={{ minWidth: 120 }} size="small"> |
| 267 | + <InputLabel id="demo-select-small-label">{t('common.language')}</InputLabel> |
| 268 | + <Select |
| 269 | + labelId="demo-select-small-label" |
| 270 | + id="demo-select-small" |
| 271 | + value={language} |
| 272 | + label={t('common.language')} |
| 273 | + onChange={handleLanguageChange} |
| 274 | + > |
| 275 | + <MenuItem value={'en'}>{t('common.english')}</MenuItem> |
| 276 | + <MenuItem value={'de'}>{t('common.german')}</MenuItem> |
| 277 | + </Select> |
| 278 | + </FormControl> |
| 279 | + |
244 | 280 | </div> |
245 | 281 | <div className={styles.responseMsg}> |
246 | 282 | {[responseMsg].filter(value => !!value).map((value, index) => |
|
0 commit comments