mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
feat(mobile): refine TREK navigation and interfaces
This commit is contained in:
@@ -9,6 +9,7 @@ import { type DateField, dateFieldOrder, dateLayout, formatDisplayDate } from '.
|
||||
import { useDateFormat } from '../../hooks/useDateFormat';
|
||||
import { useRemeasureSignal } from '../../hooks/useAnchoredPosition';
|
||||
import { useWeekStartDay } from '../../hooks/useWeekStartDay';
|
||||
import { useOverlay } from '../../hooks/overlayStack';
|
||||
import { leadingBlanks, weekdayLabels } from '../../utils/calendarWeek';
|
||||
import { selectionHaptic } from '../../native/haptics';
|
||||
|
||||
@@ -33,6 +34,7 @@ interface CustomDatePickerProps {
|
||||
max?: string;
|
||||
/** What the field is, for a picker without a visible label around it; the trigger reads it with its date. */
|
||||
ariaLabel?: string;
|
||||
clearLabel?: string;
|
||||
}
|
||||
|
||||
export function CustomDatePicker({
|
||||
@@ -46,6 +48,7 @@ export function CustomDatePicker({
|
||||
min,
|
||||
max,
|
||||
ariaLabel,
|
||||
clearLabel,
|
||||
}: CustomDatePickerProps) {
|
||||
const { locale, t } = useTranslation();
|
||||
const weekStart = useWeekStartDay();
|
||||
@@ -203,6 +206,7 @@ export function CustomDatePicker({
|
||||
|
||||
const [textInput, setTextInput] = useState('');
|
||||
const [isTyping, setIsTyping] = useState(false);
|
||||
useOverlay(open || isTyping, () => { setOpen(false); setIsTyping(false); }, true);
|
||||
|
||||
const handleTextSubmit = () => {
|
||||
setIsTyping(false);
|
||||
@@ -677,7 +681,7 @@ export function CustomDatePicker({
|
||||
onChange('');
|
||||
setOpen(false);
|
||||
}}
|
||||
aria-label={t('common.datepicker.clearDate')}
|
||||
aria-label={clearLabel ?? t('common.datepicker.clearDate')}
|
||||
style={{
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
|
||||
Reference in New Issue
Block a user