Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoistP committed Dec 27, 2024
1 parent 07b3c24 commit 71c2446
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/components/layouts/SettingsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ const RealtimeRentMenuItem: FC = () => {
)
}

const RealtimeRentMenuSelectDate: FC<{ isCalendarOpen: boolean, setIsCalendarOpen: (open: boolean) => void }> = ({ isCalendarOpen, setIsCalendarOpen }) => {
const RealtimeRentMenuSelectDate: FC<{
isCalendarOpen: boolean
setIsCalendarOpen: (open: boolean) => void
}> = ({ isCalendarOpen, setIsCalendarOpen }) => {
const dispatch = useDispatch()
const rentCalculation = useSelector(selectUserRentCalculation)
const { i18n, t } = useTranslation('common', { keyPrefix: 'settings' })
Expand All @@ -172,19 +175,28 @@ const RealtimeRentMenuSelectDate: FC<{ isCalendarOpen: boolean, setIsCalendarOpe
locale={i18n.language}
valueFormat={t('dateFormat')}
value={new Date(rentCalculation.date)}
onChange={(value) => {handleDateChange(value as Date) ; toggleIsCalendarOpen()}}
onChange={(value) => {
handleDateChange(value as Date)
toggleIsCalendarOpen()
}}
defaultDate={new Date()}
/>
<Menu.Divider />
</>
)
}

const RealtimeRentMenu: FC<{ isCalendarOpen: boolean, setIsCalendarOpen: (open: boolean) => void }> = ({ isCalendarOpen, setIsCalendarOpen }) => {
const RealtimeRentMenu: FC<{
isCalendarOpen: boolean
setIsCalendarOpen: (open: boolean) => void
}> = ({ isCalendarOpen, setIsCalendarOpen }) => {
return (
<>
<RealtimeRentMenuItem />
<RealtimeRentMenuSelectDate isCalendarOpen={isCalendarOpen} setIsCalendarOpen={setIsCalendarOpen} />
<RealtimeRentMenuSelectDate
isCalendarOpen={isCalendarOpen}
setIsCalendarOpen={setIsCalendarOpen}
/>
<Menu.Divider />
</>
)
Expand Down Expand Up @@ -363,7 +375,10 @@ export const SettingsMenu: FC = () => {
<Menu.Divider />
<CurrencySelect />
<Menu.Divider />
<RealtimeRentMenu isCalendarOpen={isCalendarOpen} setIsCalendarOpen={setIsCalendarOpen} />
<RealtimeRentMenu
isCalendarOpen={isCalendarOpen}
setIsCalendarOpen={setIsCalendarOpen}
/>
<ColorSchemeMenuItem />
<Menu.Divider />
<FetchDataSettings />
Expand Down

0 comments on commit 71c2446

Please sign in to comment.