113 lines
4.5 KiB
TypeScript
113 lines
4.5 KiB
TypeScript
// Metro module 11829 (f11830).
|
|
import { HubEmailConnectionSteps } from "../../HubConstants";
|
|
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
|
|
import { NAV_BAR_HEIGHT } from "../../../../design/components/Navigator/native/NavigatorConstants.native";
|
|
import { getHeaderBackButton, getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
|
|
import HubEmailConnectionStudentPrompt from "./HubEmailConnectionStudentPrompt";
|
|
import { ImpressionNames } from "../../../../_bundle/Module503";
|
|
import HubEmailConnectionContent from "./HubEmailConnectionContent";
|
|
import HubEmailConnectionWaitlist from "./HubEmailConnectionWaitlist";
|
|
import HubEmailConnectionSubmitSchool from "./HubEmailConnectionSubmitSchool";
|
|
import HubEmailConnectionGuildSelect from "./HubEmailConnectionGuildSelect";
|
|
import HubEmailConnectionPinVerify from "./HubEmailConnectionPinVerify";
|
|
import HubEmailConnectionGuildSelectSearch from "./HubEmailConnectionGuildSelectSearch";
|
|
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
|
|
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
|
|
import useInitialValue from "../../../../hooks/useInitialValue";
|
|
import HubEmailConnectionModalActionCreators from "./HubEmailConnectionModalActionCreators";
|
|
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
const useStyles = createStyles({
|
|
safeArea: {
|
|
marginTop: NAV_BAR_HEIGHT,
|
|
flex: 1
|
|
}
|
|
});
|
|
export default function HubEmailConnectionModal(props) {
|
|
const { isNestedNavigator, onCloseExtra, invite, displayStudentPrompt } = props;
|
|
const navigation = useNavigation();
|
|
const initialValue = useInitialValue(() => {
|
|
const handleClose = function handleClose(r4 = false) {
|
|
if (onCloseExtra != null) {
|
|
onCloseExtra(r4 === true);
|
|
}
|
|
if (isNestedNavigator) {
|
|
navigation.goBack();
|
|
} else {
|
|
HubEmailConnectionModalActionCreators.close();
|
|
}
|
|
};
|
|
const initialRouteStack = [];
|
|
const r3 = {
|
|
name: null,
|
|
params: null
|
|
};
|
|
if (displayStudentPrompt) {
|
|
r3.name = HubEmailConnectionSteps.STUDENT_PROMPT;
|
|
r3.params = {
|
|
onClose: handleClose
|
|
};
|
|
initialRouteStack.push(r3);
|
|
} else {
|
|
r3.name = HubEmailConnectionSteps.VERIFY_EMAIL;
|
|
r3.params = {
|
|
invite,
|
|
onClose: handleClose
|
|
};
|
|
initialRouteStack.push(r3);
|
|
}
|
|
const headerLeft = isNestedNavigator ? getHeaderBackButton(handleClose) : getHeaderCloseButton(handleClose);
|
|
const screens = {};
|
|
screens[HubEmailConnectionSteps.STUDENT_PROMPT] = {
|
|
fullscreen: true,
|
|
headerLeft,
|
|
headerTitle: () => null,
|
|
render: (a0) => <HubEmailConnectionStudentPrompt {...a0} />
|
|
};
|
|
screens[HubEmailConnectionSteps.VERIFY_EMAIL] = {
|
|
impressionName: ImpressionNames.HUB_EMAIL_SIGNUP,
|
|
impressionProperties: (a0) => ({
|
|
has_invite: a0.invite != null
|
|
}),
|
|
fullscreen: true,
|
|
headerLeft,
|
|
headerTitle: () => null,
|
|
render: (a0) => <HubEmailConnectionContent {...a0} />
|
|
};
|
|
screens[HubEmailConnectionSteps.EMAIL_WAITLIST] = {
|
|
fullscreen: true,
|
|
headerTitle: () => null,
|
|
render: (a0) => <HubEmailConnectionWaitlist {...a0} />
|
|
};
|
|
screens[HubEmailConnectionSteps.SUBMIT_SCHOOL] = {
|
|
fullscreen: true,
|
|
headerTitle: () => null,
|
|
render: (a0) => <HubEmailConnectionSubmitSchool {...a0} />
|
|
};
|
|
screens[HubEmailConnectionSteps.SELECT_SCHOOL] = {
|
|
fullscreen: true,
|
|
headerTitle: () => null,
|
|
render: (a0) => <HubEmailConnectionGuildSelect {...a0} />
|
|
};
|
|
screens[HubEmailConnectionSteps.VERIFY_PIN] = {
|
|
fullscreen: true,
|
|
headerTitle: () => null,
|
|
render: (a0) => <HubEmailConnectionPinVerify {...a0} />
|
|
};
|
|
screens[HubEmailConnectionSteps.SELECT_SCHOOL_SEARCH] = {
|
|
fullscreen: true,
|
|
headerShown: false,
|
|
render: (a0) => <HubEmailConnectionGuildSelectSearch {...a0} />
|
|
};
|
|
return {
|
|
screens,
|
|
initialRouteStack
|
|
};
|
|
});
|
|
return <Navigator screens={initialValue.screens} initialRouteStack={initialValue.initialRouteStack} headerBackTitle={intl.string(t["13/7kX"])} />;
|
|
};
|
|
export function HubEmailConnectionScreen(props) {
|
|
const children = props.children;
|
|
return <SafeAreaPaddingView top style={useStyles().safeArea}>{children}</SafeAreaPaddingView>;
|
|
}
|