diff --git a/src/app/features/settings/general/General.tsx b/src/app/features/settings/general/General.tsx index 6b5c0fe3..24278802 100644 --- a/src/app/features/settings/general/General.tsx +++ b/src/app/features/settings/general/General.tsx @@ -13,6 +13,7 @@ import { Button, Chip, config, + Header, Icon, IconButton, Icons, @@ -345,11 +346,175 @@ function Appearance() { ); } +type DateHintProps = { + hasChanges: boolean; + handleReset: () => void; +}; +function DateHint({ hasChanges, handleReset }: DateHintProps) { + const [anchor, setAnchor] = useState(); + const categoryPadding = { padding: config.space.S200, paddingTop: 0 }; + + const handleOpenMenu: MouseEventHandler = (evt) => { + setAnchor(evt.currentTarget.getBoundingClientRect()); + }; + return ( + setAnchor(undefined), + clickOutsideDeactivates: true, + escapeDeactivates: stopPropagation, + }} + > + +
+ Formatting +
+ + +
+ Year +
+ + + YY + + {': '} + Two-digit year + {' '} + + + YYYY + + {': '}Four-digit year + + + +
+ + +
+ Month +
+ + + M + + {': '}The month + + + + MM + + {': '}Two-digit month + {' '} + + + MMM + + {': '}Short month name + + + + MMMM + + {': '}Full month name + + + +
+ + +
+ Day of the Month +
+ + + D + + {': '}Day of the month + + + + DD + + {': '}Two-digit day of the month + + + +
+ +
+ Day of the Week +
+ + + d + + {': '}Day of the week (Sunday = 0) + + + + dd + + {': '}Two-letter day name + + + + ddd + + {': '}Short day name + + + + dddd + + {': '}Full day name + + + +
+
+ + } + > + {hasChanges ? ( + + + + ) : ( + + + + )} +
+ ); +} + type CustomDateFormatProps = { value: string; onChange: (format: string) => void; }; - function CustomDateFormat({ value, onChange }: CustomDateFormatProps) { const [dateFormatCustom, setDateFormatCustom] = useState(value); @@ -379,21 +544,7 @@ function CustomDateFormat({ value, onChange }: CustomDateFormatProps) { const hasChanges = dateFormatCustom !== value; return ( - - View formatting syntax on{' '} - - Day.js - - . - - } - > + - - - ) - } + after={} />