Files
discord-decomp/modules/verification/native/components/CountrySelectModal.tsx
T
2026-11-01 12:12:55 +02:00

24 lines
1.3 KiB
TypeScript

// Metro module 9237 (f9238).
import { useMemo, useEffect } from "react";
import { intl, t } from "../../../../intl/index.native";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import CountryCallingCodeSelect from "../../../phone/native/CountryCallingCodeSelect";
import PhoneActionCreators from "../../../phone/PhoneActionCreators";
import RunAfterInteractionsUtils from "../../../../utils/native/RunAfterInteractionsUtils";
import PhoneVerificationActionCreators from "../../../../actions/native/PhoneVerificationActionCreators";
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
export default function CountrySelectModal() {
const memo = useMemo(() => ({
COUNTRY_SELECT: {
title: intl.string(t.gzXECH),
headerLeft: getHeaderCloseButton(ModalActionCreators.pop),
render: () => <CountryCallingCodeSelect onClose={() => ModalActionCreators.pop()} onCountrySelected={(event) => PhoneActionCreators.setCountryCode(event)} />
}
}), []);
useEffect(() => () => {
RunAfterInteractionsUtils.runAfterInteractions(PhoneVerificationActionCreators.setCountrySelectorClosed, 400);
}, []);
return <Navigator screens={memo} initialRouteName="COUNTRY_SELECT" />;
};