Skip to content

Commit

Permalink
Bump frontend npm packages to latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Jul 23, 2023
1 parent 72e1a1a commit fcac57a
Show file tree
Hide file tree
Showing 5 changed files with 312 additions and 435 deletions.
2 changes: 0 additions & 2 deletions backend/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const App = ({ Component, pageProps }) => {
}, [])

useEffect(() => {

(async function () {
const lang = await SettingService.getLanguage()
const isFr = lang === 'fr'
Expand Down Expand Up @@ -130,7 +129,6 @@ const App = ({ Component, pageProps }) => {

setTheme(theme)
})()

}, [])

if (!theme) {
Expand Down
42 changes: 9 additions & 33 deletions frontend/components/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import React, { useEffect, useState } from 'react'
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
import { DatePicker as MuiDatePicker } from '@mui/x-date-pickers/DatePicker'
import { TextField, IconButton, InputAdornment } from '@mui/material'
import { Clear as ClearIcon } from '@mui/icons-material'
import { fr, enUS } from "date-fns/locale"

const DatePicker = ({ label, language, value, minDate, required, onChange }) => {
const [date, setDate] = useState()
const [date, setDate] = useState(value || null)

useEffect(() => {
setDate(value)
Expand All @@ -29,36 +27,14 @@ const DatePicker = ({ label, language, value, minDate, required, onChange }) =>
minDate={minDate}
defaultCalendarMonth={minDate}
required={required}
renderInput={(params) =>
<TextField
{...params}
variant='standard'
fullWidth
required={required}
autoComplete='off'
InputProps={{
...params.InputProps,
endAdornment:
<>
{
value && (
<InputAdornment position='end' className='d-adornment'>
<IconButton
size='small'
onClick={() => {
setDate(null)
if (onChange) onChange(null)
}}>
<ClearIcon className='d-adornment-icon' />
</IconButton>
</InputAdornment>
)
}
{params.InputProps.endAdornment}
</>
}}
/>
}
slotProps={{
textField: {
variant: 'standard',
},
actionBar: {
actions: ['accept', 'cancel', 'today', 'clear']
}
}}
/>
</LocalizationProvider>
)
Expand Down

0 comments on commit fcac57a

Please sign in to comment.