mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
export modal
This commit is contained in:
parent
09182add06
commit
0c3fb8ff2f
1 changed files with 11 additions and 8 deletions
|
@ -99,13 +99,8 @@ function LocalTimestampInner(props: LocalTimestampProps): JSX.Element | null {
|
||||||
className={classes}
|
className={classes}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
toolTipProps.onClick();
|
toolTipProps.onClick();
|
||||||
openModal(modalProps =>
|
openTimezoneOverwriteModal(props.userId);
|
||||||
<TimezoneOverrideModal
|
}}>
|
||||||
userId={props.userId}
|
|
||||||
modalProps={modalProps} />,
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{shortTimeFormatted}
|
{shortTimeFormatted}
|
||||||
</span>
|
</span>
|
||||||
</>}
|
</>}
|
||||||
|
@ -118,7 +113,7 @@ interface TimezoneOverrideModalProps {
|
||||||
modalProps: ModalProps,
|
modalProps: ModalProps,
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TimezoneOverrideModal(props: TimezoneOverrideModalProps) {
|
function TimezoneOverrideModal(props: TimezoneOverrideModalProps) {
|
||||||
const [availableTimezones, setAvailableTimezones] = useState<SelectOption[]>();
|
const [availableTimezones, setAvailableTimezones] = useState<SelectOption[]>();
|
||||||
const [timezone, setTimezone] = useState<string | "NONE" | undefined>();
|
const [timezone, setTimezone] = useState<string | "NONE" | undefined>();
|
||||||
|
|
||||||
|
@ -212,3 +207,11 @@ export function TimezoneOverrideModal(props: TimezoneOverrideModalProps) {
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</ModalRoot>;
|
</ModalRoot>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function openTimezoneOverwriteModal(userId: string) {
|
||||||
|
openModal(modalProps => <>
|
||||||
|
<ErrorBoundary>
|
||||||
|
<TimezoneOverrideModal userId={userId} modalProps={modalProps} />
|
||||||
|
</ErrorBoundary>
|
||||||
|
</>);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue