diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-02-03 12:27:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-03 20:27:58 +0000 |
commit | 23e62b18de9537b50c8b1df2b4744adc030501d0 (patch) | |
tree | 557037a964f2a8f7a3583ae84fc3b67b498c1ed2 /src/components/dialogs/BirthDateSettings.tsx | |
parent | 25991af7224cd76a8722f0579c00b73a211a84cc (diff) | |
download | voidsky-23e62b18de9537b50c8b1df2b4744adc030501d0.tar.zst |
Date input improvements (#7639)
* add max date, use modern field for birthday input * rm legacy date input * handle simplifying to simpleDateString internally * update jsdoc
Diffstat (limited to 'src/components/dialogs/BirthDateSettings.tsx')
-rw-r--r-- | src/components/dialogs/BirthDateSettings.tsx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/components/dialogs/BirthDateSettings.tsx b/src/components/dialogs/BirthDateSettings.tsx index 8f47d05b0..9fbf378ac 100644 --- a/src/components/dialogs/BirthDateSettings.tsx +++ b/src/components/dialogs/BirthDateSettings.tsx @@ -12,12 +12,12 @@ import { usePreferencesSetBirthDateMutation, } from '#/state/queries/preferences' import {ErrorMessage} from '#/view/com/util/error/ErrorMessage' -import {DateInput} from '#/view/com/util/forms/DateInput' import {atoms as a, useTheme} from '#/alf' import * as Dialog from '#/components/Dialog' +import {DateField} from '#/components/forms/DateField' import {Loader} from '#/components/Loader' +import {Text} from '#/components/Typography' import {Button, ButtonIcon, ButtonText} from '../Button' -import {Text} from '../Typography' export function BirthDateSettingsDialog({ control, @@ -95,17 +95,13 @@ function BirthdayInner({ return ( <View style={a.gap_lg} testID="birthDateSettingsDialog"> <View style={isIOS && [a.w_full, a.align_center]}> - <DateInput - handleAsUTC + <DateField testID="birthdayInput" value={date} - onChange={setDate} - buttonType="default-light" - buttonStyle={[a.rounded_sm]} - buttonLabelType="lg" - accessibilityLabel={_(msg`Birthday`)} + onChangeDate={newDate => setDate(new Date(newDate))} + label={_(msg`Birthday`)} accessibilityHint={_(msg`Enter your birth date`)} - accessibilityLabelledBy="birthDate" + maximumDate={new Date()} /> </View> |