657 lines
23 KiB
TypeScript
657 lines
23 KiB
TypeScript
// Metro module 11108 (f11109).
|
|
import { useCallback, useEffect, useRef, useMemo } from "react";
|
|
import { View, Image } from "react-native";
|
|
import UserStore from "../../../stores/UserStore";
|
|
import { FAMILY_CENTER_LINK_REQUEST_ERROR_EXPERIENCES, FamilyCenterIconType, FamilyCenterFailureCode, FAMILY_CENTER_AGE_VERIFICATION_RESUME_TIMEOUT } from "../FamilyCenterConstants";
|
|
import { jsx } from "react/jsx-runtime";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
|
|
import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual";
|
|
import FamilyCenterActionCreators from "../FamilyCenterActionCreators";
|
|
import { FamilyCenterModalRequestSections, resolveConnectionPrereqTarget } from "../FamilyCenterModalRequestRouting";
|
|
import { getFailureCodeForAPIError } from "../FamilyCenterUtils";
|
|
import { useFamilyCenterActions } from "../hooks/useFamilyCenterActions";
|
|
import { ModalScreen } from "../../../design/components/Modal/native/ModalScreen.native";
|
|
import { ModalContent } from "../../../design/components/Modal/native/ModalContent.native";
|
|
import { AvatarSizes, Avatar, generateBoxShadowStyle, FOUR_DP_ELEVATION_SHADOW_PARAMS, Icon } from "../../../design/void/native";
|
|
import AvatarUtils from "../../../utils/AvatarUtils";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import FamilyCenter_messages from "../FamilyCenter.messages";
|
|
import { Text } from "../../../design/components/Text/native/Text";
|
|
import Module11111 from "../../../_bundle/Module11111";
|
|
import { ModalFooter } from "../../../design/components/Modal/native/ModalFooter.native";
|
|
import { ButtonGroup } from "../../../design/components/ButtonGroup/native/ButtonGroup.native";
|
|
import { Button } from "../../../design/components/Button/native/Button.native";
|
|
import ModalActionCreators from "../../../actions/ModalActionCreators";
|
|
import { EnvelopeSpotIllustration, FamilyShieldSpotIllustration } from "../../../design/assets/native";
|
|
import useIsInAdultAgeGroup from "../hooks/useIsInAdultAgeGroup";
|
|
import Module38 from "../../../_bundle/Module38";
|
|
import Module10008 from "../../../_bundle/Module10008";
|
|
import Module7699 from "../../../_bundle/Module7699";
|
|
import { ActivityIndicator } from "../../../design/components/ActivityIndicator/native/ActivityIndicator.native";
|
|
import usePrevious from "../../../hooks/usePrevious";
|
|
import { AgeVerificationStatusUkAndAusOnly } from "../../../flow/Server";
|
|
import AgeVerificationActionCreators_native from "../../age_assurance/AgeVerificationActionCreators.native";
|
|
import { AgeVerificationModalEntryPoint } from "../../age_assurance/AgeVerificationAnalyticsUtils";
|
|
import { useIsAgeVerified } from "../../age_assurance/AgeVerificationUtils";
|
|
import { getHeaderCloseButton } from "../../../design/components/Navigator/native/NavigatorHeader.native";
|
|
import { FamilyCenterConnectionPrereqExperiment } from "../FamilyCenterConnectionPrereqExperiment";
|
|
import { Modal } from "../../../design/components/Modal/native/Modal.native";
|
|
import { HermesBuiltin } from "../../../_hermes/prelude";
|
|
function $mk86418($env) {
|
|
return () => {
|
|
const r3 = $env;
|
|
const r5 = r3[2];
|
|
let r0 = r5 != null && r5 !== r3[1] && r3[1] != null;
|
|
if (r0) {
|
|
const r8 = r3[1];
|
|
const r9 = $env.$parent;
|
|
r0 = r8 !== (0, r9[0])(r9[2][34]).AgeVerificationStatusUkAndAusOnly.UNVERIFIED;
|
|
}
|
|
if (r0) {
|
|
const r16 = r3[0];
|
|
const r18 = $env.$parent;
|
|
r16.replace((0, r18[0])(r18[2][11]).FamilyCenterModalRequestSections.VERIFYING);
|
|
}
|
|
};
|
|
}
|
|
let FamilyCenterModalRequestSuccess, FamilyCenterModalRequestError, FamilyCenterPrereqLoading, FamilyCenterPrereqScreen, FamilyCenterConfirmAgeScreen, FamilyCenterVerifyingScreen, FamilyCenterPrereqInvalidCodeScreen, FamilyCenterPrereqMustBeAdultScreen, useStyles, useStyles2, useStyles3, useStyles4, useStyles5, useStyles6, c7501_30;
|
|
let $mk86417 = function() {
|
|
return () => UserStore.getCurrentUser()?.ageVerificationStatus;
|
|
};
|
|
let env7501 = {};
|
|
export function FamilyCenterModalRequestConfirm(props) {
|
|
let r80, r81, jsx2;
|
|
let requestLink;
|
|
const { userId, linkCode, teenIdentity } = props;
|
|
requestLink = void 0;
|
|
const styles = useStyles();
|
|
const navigation = useNavigation();
|
|
const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
|
|
const familyCenterActions = useFamilyCenterActions({
|
|
onSuccess: useCallback(() => {
|
|
FamilyCenterActionCreators.clearPendingConnection();
|
|
navigation.push(FamilyCenterModalRequestSections.SENT);
|
|
}, [navigation]),
|
|
onError: useCallback((a0) => {
|
|
navigation.push(FamilyCenterModalRequestSections.ERROR, {
|
|
failureCode: getFailureCodeForAPIError(a0)
|
|
});
|
|
}, [navigation])
|
|
});
|
|
requestLink = familyCenterActions.requestLink;
|
|
const isRequestingLink = familyCenterActions.isRequestingLink;
|
|
const callback = useCallback(() => {
|
|
requestLink(userId, linkCode);
|
|
}, [requestLink, userId, linkCode]);
|
|
if (teenIdentity != null) {
|
|
const props2 = {
|
|
source: stateFromStores2 != null ? AvatarUtils.getUserAvatarSource(stateFromStores2) : void 0,
|
|
size: AvatarSizes.LARGE,
|
|
accessibilityLabel: null
|
|
};
|
|
let name = stateFromStores2?.globalName;
|
|
if (name == null) {
|
|
name = stateFromStores2?.username;
|
|
}
|
|
if (name == null) {
|
|
name = "";
|
|
}
|
|
props2.accessibilityLabel = intl.formatToPlainString(FamilyCenter_messages.kFj4h1, {
|
|
name
|
|
});
|
|
const r113 = [<Avatar {...props2} />, <View style={styles.ellipseGroup}>
|
|
<View style={styles.ellipse} />
|
|
<View style={styles.ellipse} />
|
|
<View style={styles.ellipse} />
|
|
</View>, ,];
|
|
const props3 = {
|
|
source: AvatarUtils.getUserAvatarSource({
|
|
id: teenIdentity.id,
|
|
avatar: teenIdentity.avatar,
|
|
discriminator: "0"
|
|
}),
|
|
size: AvatarSizes.LARGE,
|
|
accessibilityLabel: null
|
|
};
|
|
let global_name = teenIdentity.global_name;
|
|
if (global_name == null) {
|
|
global_name = teenIdentity.username;
|
|
}
|
|
props3.accessibilityLabel = intl.formatToPlainString(FamilyCenter_messages.kFj4h1, {
|
|
name: global_name
|
|
});
|
|
r113[2] = <Avatar {...props3} />;
|
|
const r154 = [<View style={styles.headerIcons}>{r113}</View>, <Text variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles.title}>
|
|
{intl.string(FamilyCenter_messages.sMmIbm)}
|
|
</Text>, , ,];
|
|
let global_name2 = teenIdentity.global_name;
|
|
if (global_name2 == null) {
|
|
global_name2 = teenIdentity.username;
|
|
}
|
|
r154[2] = <Text variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles.teenName}>{global_name2}</Text>;
|
|
let global_name3 = teenIdentity.global_name;
|
|
if (global_name3 == null) {
|
|
global_name3 = teenIdentity.username;
|
|
}
|
|
r154[3] = <Text variant="text-sm/medium" color="text-muted" style={styles.consent}>
|
|
{intl.format(FamilyCenter_messages.yiUJNU, {
|
|
username: global_name3
|
|
})}
|
|
</Text>;
|
|
r80 = <View style={styles.connectionHeader}>{r154}</View>;
|
|
r81 = importDefault;
|
|
jsx2 = jsx;
|
|
} else {
|
|
r80 = <>
|
|
<Image style={styles.art} source={Module11111} />
|
|
<Text style={styles.headerText} variant="text-lg/bold">
|
|
{intl.string(FamilyCenter_messages.GH11eI)}
|
|
</Text>
|
|
</>;
|
|
r81 = importDefault;
|
|
jsx2 = jsx;
|
|
}
|
|
return <ModalScreen>
|
|
<ModalContent>
|
|
{r80}
|
|
{jsx2(r81(dependencyMap[22]), {})}
|
|
</ModalContent>
|
|
{jsx2(ModalFooter, {
|
|
children: <ButtonGroup>
|
|
{jsx2(Button, {
|
|
variant: "primary",
|
|
size: "lg",
|
|
disabled: isRequestingLink,
|
|
loading: isRequestingLink,
|
|
text: intl.string(r81(dependencyMap[19]).ISg34l),
|
|
onPress: callback
|
|
})}
|
|
{jsx2(Button, {
|
|
variant: "secondary",
|
|
size: "lg",
|
|
text: intl.string(t["ETE/oC"]),
|
|
onPress: r81(dependencyMap[26]).pop
|
|
})}
|
|
</ButtonGroup>
|
|
})}
|
|
</ModalScreen>;
|
|
}
|
|
FamilyCenterModalRequestSuccess = function FamilyCenterModalRequestSuccess() {
|
|
const styles2 = useStyles2();
|
|
const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
|
|
const callback = useCallback(() => {
|
|
ModalActionCreators.pop();
|
|
}, []);
|
|
if (stateFromStores2 === null) {
|
|
ModalActionCreators.pop();
|
|
}
|
|
return <ModalScreen>
|
|
<ModalContent>
|
|
<View style={styles2.content}>
|
|
<View style={styles2.textWrapper}>
|
|
<View style={styles2.illustration}>
|
|
<EnvelopeSpotIllustration scale={0.7} />
|
|
</View>
|
|
<Text variant="heading-lg/bold" color="mobile-text-heading-primary" style={styles2.header}>
|
|
{intl.string(FamilyCenter_messages.EpwfZl)}
|
|
</Text>
|
|
<Text variant="text-sm/medium" color="text-muted" style={styles2.description}>
|
|
{intl.format(FamilyCenter_messages.dVtWId, {
|
|
email: stateFromStores2?.email
|
|
})}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
</ModalContent>
|
|
<ModalFooter>
|
|
<Button size="lg" text={intl.string(t.cpT0Cq)} onPress={callback} />
|
|
</ModalFooter>
|
|
</ModalScreen>;
|
|
};
|
|
FamilyCenterModalRequestError = function FamilyCenterModalRequestError(props) {
|
|
const failureCode = props.failureCode;
|
|
const styles3 = useStyles3();
|
|
const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
|
|
const isInAdultAgeGroup = useIsInAdultAgeGroup();
|
|
const r19 = generateBoxShadowStyle(FOUR_DP_ELEVATION_SHADOW_PARAMS);
|
|
const callback = useCallback(() => {
|
|
ModalActionCreators.pop();
|
|
}, []);
|
|
Module38(stateFromStores2 != null, "User must be logged in to see this modal.");
|
|
const r43 = FAMILY_CENTER_LINK_REQUEST_ERROR_EXPERIENCES[failureCode];
|
|
let isAdult = isInAdultAgeGroup;
|
|
if (isAdult == null) {
|
|
isAdult = void 0;
|
|
}
|
|
let email = stateFromStores2.email;
|
|
if (email == null) {
|
|
email = void 0;
|
|
}
|
|
const r45 = {
|
|
isAdult,
|
|
email
|
|
};
|
|
const r17 = r43.header(r45);
|
|
const r14 = r43.description(r45);
|
|
const icon = r43.icon;
|
|
return <ModalScreen>
|
|
<ModalContent>
|
|
<View style={[styles3.ring, r19]}>
|
|
<View style={[styles3.iconContainer, icon === FamilyCenterIconType.CHECK ? styles3.positive : styles3.negative]}>
|
|
{icon === FamilyCenterIconType.CHECK ? <Icon source={Module10008} color="#FFF" /> : <Icon source={Module7699} color="#FFF" />}
|
|
</View>
|
|
</View>
|
|
<Text variant="heading-lg/bold" color="mobile-text-heading-primary" style={styles3.header}>{r17}</Text>
|
|
<Text variant="text-sm/medium" color="text-muted" style={styles3.description}>{r14}</Text>
|
|
</ModalContent>
|
|
<ModalFooter>
|
|
<Button text={intl.string(t.cpT0Cq)} onPress={callback} />
|
|
</ModalFooter>
|
|
</ModalScreen>;
|
|
};
|
|
FamilyCenterPrereqLoading = function FamilyCenterPrereqLoading(props) {
|
|
const { userId: userId2, linkCode: linkCode2 } = props;
|
|
const styles4 = useStyles4();
|
|
const navigation2 = useNavigation();
|
|
useEffect(() => {
|
|
let c26941_0;
|
|
let _runPrereq2 = function _runPrereq() {
|
|
const r9 = async () => {
|
|
let c31607_1;
|
|
let c32026_0;
|
|
L15: {
|
|
c31607_1 = void 0;
|
|
c32026_0 = void 0;
|
|
c32026_0 = await resolveConnectionPrereqTarget(userId2, linkCode2);
|
|
if (!c26941_0) {
|
|
if (c32026_0.section !== FamilyCenterModalRequestSections.ERROR) {
|
|
if (c32026_0.section !== FamilyCenterModalRequestSections.REQUEST) {
|
|
if (c32026_0.section !== FamilyCenterModalRequestSections.CONFIRM_AGE) {
|
|
navigation2.replace(c32026_0.section);
|
|
break L15;
|
|
}
|
|
}
|
|
}
|
|
navigation2.replace(c32026_0.section, c32026_0.params);
|
|
}
|
|
}
|
|
};
|
|
_runPrereq2 = r9;
|
|
return r9.apply(this, arguments);
|
|
};
|
|
c26941_0 = false;
|
|
(function runPrereq() {
|
|
return _runPrereq2.apply(this, arguments);
|
|
})();
|
|
return () => {
|
|
c26941_0 = true;
|
|
};
|
|
}, []);
|
|
return <ModalScreen>
|
|
<View style={styles4.container}>
|
|
<ActivityIndicator />
|
|
</View>
|
|
</ModalScreen>;
|
|
};
|
|
FamilyCenterPrereqScreen = function FamilyCenterPrereqScreen(props) {
|
|
const { title, description, primaryButton } = props;
|
|
const styles5 = useStyles5();
|
|
return <ModalScreen>
|
|
<View style={styles5.content}>
|
|
<Text variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles5.title}>{title}</Text>
|
|
<Text variant="text-sm/medium" color="text-muted" style={styles5.description}>{description}</Text>
|
|
</View>
|
|
<ModalFooter>
|
|
<Button text={primaryButton.text} onPress={primaryButton.onPress} />
|
|
</ModalFooter>
|
|
</ModalScreen>;
|
|
};
|
|
FamilyCenterConfirmAgeScreen = function FamilyCenterConfirmAgeScreen(props) {
|
|
let env18541;
|
|
const teenIdentity = props.teenIdentity;
|
|
const styles6 = useStyles6();
|
|
const r24 = env18541 = {
|
|
$parent: env7501
|
|
};
|
|
env18541[0] = void 0;
|
|
env18541[1] = void 0;
|
|
env18541[2] = void 0;
|
|
const navigation4 = useNavigation();
|
|
env18541[0] = navigation4;
|
|
const stateFromStores2 = useStateFromStores([UserStore], $mk86417());
|
|
env18541[1] = stateFromStores2;
|
|
const previous = usePrevious(stateFromStores2);
|
|
env18541[2] = previous;
|
|
useEffect($mk86418(r24), [stateFromStores2, previous, navigation4]);
|
|
const callback = useCallback(() => {
|
|
AgeVerificationActionCreators_native.showAgeVerificationGetStartedModal({
|
|
entryPoint: AgeVerificationModalEntryPoint.FAMILY_CENTER_CONNECTION
|
|
});
|
|
}, []);
|
|
const r56 = [<View style={styles6.art}>
|
|
<FamilyShieldSpotIllustration />
|
|
</View>, , ,];
|
|
let username = teenIdentity?.global_name;
|
|
if (username == null) {
|
|
username = teenIdentity?.username;
|
|
}
|
|
if (username == null) {
|
|
username = "";
|
|
}
|
|
r56[1] = <Text variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles6.title}>
|
|
{intl.formatToPlainString(FamilyCenter_messages.pQQMJ7, {
|
|
username
|
|
})}
|
|
</Text>;
|
|
r56[2] = <Text variant="text-sm/medium" color="text-muted" style={styles6.description}>
|
|
{intl.format(FamilyCenter_messages["0o3yg8"], {
|
|
link: "https://support.discord.com/hc/articles/14155060633623"
|
|
})}
|
|
</Text>;
|
|
return <ModalScreen>
|
|
<View style={styles6.content}>{r56}</View>
|
|
<ModalFooter>
|
|
<ButtonGroup>
|
|
<Button variant="primary" text={intl.string(FamilyCenter_messages["3oUE4o"])} onPress={callback} />
|
|
<Button variant="tertiary" text={intl.string(t.oEAioF)} onPress={() => ModalActionCreators.pop()} />
|
|
</ButtonGroup>
|
|
</ModalFooter>
|
|
</ModalScreen>;
|
|
};
|
|
FamilyCenterVerifyingScreen = function FamilyCenterVerifyingScreen() {
|
|
let ref;
|
|
const styles4 = useStyles4();
|
|
const navigation3 = useNavigation();
|
|
const isAgeVerified = useIsAgeVerified();
|
|
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser()?.ageVerificationStatus);
|
|
ref = useRef(false);
|
|
useEffect(() => {
|
|
if (isAgeVerified) {
|
|
if (ref.current) {
|
|
return void 0;
|
|
}
|
|
ref.current = true;
|
|
navigation3.replace(FamilyCenterModalRequestSections.PREREQ_LOADING);
|
|
return void 0;
|
|
}
|
|
if (stateFromStores === AgeVerificationStatusUkAndAusOnly.UNVERIFIED) {
|
|
navigation3.replace(FamilyCenterModalRequestSections.ERROR, {
|
|
failureCode: FamilyCenterFailureCode.GENERIC_ERROR
|
|
});
|
|
}
|
|
}, [isAgeVerified, stateFromStores, navigation3]);
|
|
useEffect(() => {
|
|
let c26942_0 = setTimeout(() => {
|
|
navigation3.replace(FamilyCenterModalRequestSections.ERROR, {
|
|
failureCode: FamilyCenterFailureCode.GENERIC_ERROR
|
|
});
|
|
}, FAMILY_CENTER_AGE_VERIFICATION_RESUME_TIMEOUT);
|
|
return () => clearTimeout(c26942_0);
|
|
}, [navigation3]);
|
|
return <ModalScreen>
|
|
<View style={styles4.container}>
|
|
<ActivityIndicator />
|
|
</View>
|
|
</ModalScreen>;
|
|
};
|
|
FamilyCenterPrereqInvalidCodeScreen = function FamilyCenterPrereqInvalidCodeScreen() {
|
|
return <FamilyCenterPrereqScreen title={intl.string(FamilyCenter_messages.ewSb6o)} description={intl.string(FamilyCenter_messages.jcUN2F)} primaryButton={{
|
|
text: intl.string(t.WAI6xu),
|
|
onPress: ModalActionCreators.pop
|
|
}} />;
|
|
};
|
|
FamilyCenterPrereqMustBeAdultScreen = function FamilyCenterPrereqMustBeAdultScreen() {
|
|
let env18543;
|
|
const r2 = env18543 = {
|
|
$parent: env7501
|
|
};
|
|
const navigation4 = useNavigation();
|
|
env18543[0] = navigation4;
|
|
const stateFromStores2 = useStateFromStores([UserStore], $mk86417());
|
|
env18543[1] = stateFromStores2;
|
|
const previous = usePrevious(stateFromStores2);
|
|
env18543[2] = previous;
|
|
useEffect($mk86418(r2), [stateFromStores2, previous, navigation4]);
|
|
const callback = useCallback(() => {
|
|
AgeVerificationActionCreators_native.showAgeVerificationGetStartedModal({
|
|
entryPoint: AgeVerificationModalEntryPoint.FAMILY_CENTER_CONNECTION
|
|
});
|
|
}, []);
|
|
return (0, jsx)(FamilyCenterPrereqScreen, {
|
|
title: intl.string(FamilyCenter_messages.BQFHXW),
|
|
description: intl.format(FamilyCenter_messages.WDjaKn, {
|
|
link: {
|
|
onClick: callback
|
|
}
|
|
}),
|
|
primaryButton: {
|
|
text: intl.string(t["NX+WJN"]),
|
|
onPress: ModalActionCreators.pop
|
|
}
|
|
});
|
|
};
|
|
useStyles = createStyles({
|
|
headerText: {
|
|
marginTop: Module712.space.PX_16,
|
|
marginBottom: Module712.space.PX_16
|
|
},
|
|
art: {
|
|
width: 165,
|
|
height: 119
|
|
},
|
|
connectionHeader: {
|
|
alignItems: "center",
|
|
marginBottom: Module712.space.PX_16
|
|
},
|
|
headerIcons: {
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
alignSelf: "center",
|
|
padding: Module712.space.PX_8,
|
|
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
|
|
borderRadius: Module712.radii.round,
|
|
marginBottom: Module712.space.PX_24
|
|
},
|
|
ellipseGroup: {
|
|
flexDirection: "row",
|
|
marginHorizontal: Module712.space.PX_12
|
|
},
|
|
ellipse: {
|
|
width: 4,
|
|
height: 4,
|
|
marginHorizontal: 2,
|
|
backgroundColor: Module712.colors.ICON_MUTED,
|
|
borderRadius: Module712.radii.round
|
|
},
|
|
title: {
|
|
textAlign: "center"
|
|
},
|
|
teenName: {
|
|
marginTop: Module712.space.PX_4,
|
|
textAlign: "center"
|
|
},
|
|
consent: {
|
|
marginTop: Module712.space.PX_8,
|
|
textAlign: "center",
|
|
paddingHorizontal: Module712.space.PX_16
|
|
}
|
|
});
|
|
useStyles2 = createStyles({
|
|
content: {
|
|
flex: 1,
|
|
flexDirection: "column",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
paddingHorizontal: Module712.space.PX_16
|
|
},
|
|
textWrapper: {
|
|
alignItems: "center"
|
|
},
|
|
header: {
|
|
marginBottom: Module712.space.PX_8
|
|
},
|
|
description: {
|
|
textAlign: "center"
|
|
},
|
|
illustration: {
|
|
position: "absolute",
|
|
bottom: "100%",
|
|
left: 0,
|
|
right: 0,
|
|
alignItems: "center",
|
|
paddingBottom: Module712.space.PX_24
|
|
}
|
|
});
|
|
useStyles3 = createStyles({
|
|
header: {
|
|
marginBottom: 8,
|
|
textAlign: "center"
|
|
},
|
|
description: {
|
|
textAlign: "center"
|
|
},
|
|
ring: {
|
|
display: "flex",
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
height: 64,
|
|
width: 64,
|
|
borderRadius: Module712.radii.round,
|
|
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
|
|
marginBottom: 24
|
|
},
|
|
iconContainer: {
|
|
display: "flex",
|
|
justifyContent: "center",
|
|
alignItems: "center",
|
|
height: 48,
|
|
width: 48,
|
|
borderRadius: Module712.radii.round,
|
|
backgroundColor: Module712.colors.STATUS_POSITIVE
|
|
},
|
|
positive: {
|
|
backgroundColor: Module712.colors.STATUS_POSITIVE
|
|
},
|
|
negative: {
|
|
backgroundColor: Module712.colors.BACKGROUND_FEEDBACK_CRITICAL
|
|
}
|
|
});
|
|
useStyles4 = createStyles({
|
|
container: {
|
|
flex: 1,
|
|
justifyContent: "center",
|
|
alignItems: "center"
|
|
}
|
|
});
|
|
useStyles5 = createStyles({
|
|
content: {
|
|
flex: 1,
|
|
flexDirection: "column",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
paddingHorizontal: 32
|
|
},
|
|
title: {
|
|
textAlign: "center",
|
|
marginBottom: Module712.space.PX_8
|
|
},
|
|
description: {
|
|
textAlign: "center"
|
|
}
|
|
});
|
|
useStyles6 = createStyles({
|
|
content: {
|
|
flex: 1,
|
|
flexDirection: "column",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
paddingHorizontal: 32
|
|
},
|
|
art: {
|
|
marginBottom: Module712.space.PX_24
|
|
},
|
|
title: {
|
|
textAlign: "center",
|
|
marginBottom: Module712.space.PX_8
|
|
},
|
|
description: {
|
|
textAlign: "center"
|
|
}
|
|
});
|
|
c7501_30 = {
|
|
headerShown: true,
|
|
headerLeft: getHeaderCloseButton(ModalActionCreators.pop),
|
|
headerTitle: () => null
|
|
};
|
|
export default function FamilyCenterRequestModal({ userId: userId3, linkCode: linkCode3 }) {
|
|
const isInAdultAgeGroup = useIsInAdultAgeGroup();
|
|
return (0, jsx)(Modal, {
|
|
initialRouteName: FamilyCenterConnectionPrereqExperiment.useConfig({
|
|
location: "FamilyCenterRequestModal"
|
|
}).enabled ? FamilyCenterModalRequestSections.PREREQ_LOADING : isInAdultAgeGroup ? FamilyCenterModalRequestSections.REQUEST : FamilyCenterModalRequestSections.TEEN_SCAN,
|
|
screens: useMemo(() => {
|
|
const userId4 = userId3;
|
|
const linkCode4 = linkCode3;
|
|
const r16 = {};
|
|
const PREREQ_LOADING = FamilyCenterModalRequestSections.PREREQ_LOADING;
|
|
const r20 = {};
|
|
HermesBuiltin.copyDataProperties(r20, c7501_30);
|
|
r20.render = () => (0, jsx)(FamilyCenterPrereqLoading, {
|
|
userId: userId4,
|
|
linkCode: linkCode4
|
|
});
|
|
r16[PREREQ_LOADING] = r20;
|
|
r16[FamilyCenterModalRequestSections.CONFIRM_AGE] = {
|
|
...c7501_30,
|
|
render: (a0) => <FamilyCenterConfirmAgeScreen teenIdentity={a0?.teenIdentity} />
|
|
};
|
|
r16[FamilyCenterModalRequestSections.VERIFYING] = {
|
|
...c7501_30,
|
|
render: () => (0, jsx)(FamilyCenterVerifyingScreen, {})
|
|
};
|
|
r16[FamilyCenterModalRequestSections.REQUEST] = {
|
|
headerLeft: getHeaderCloseButton(ModalActionCreators.pop),
|
|
headerShown: true,
|
|
headerTitle: () => null,
|
|
render: (a0) => <FamilyCenterModalRequestConfirm userId={userId4} linkCode={linkCode4} teenIdentity={a0?.teenIdentity} />
|
|
};
|
|
r16[FamilyCenterModalRequestSections.INVALID_CODE] = {
|
|
...c7501_30,
|
|
render: () => (0, jsx)(FamilyCenterPrereqInvalidCodeScreen, {})
|
|
};
|
|
r16[FamilyCenterModalRequestSections.MUST_BE_ADULT] = {
|
|
...c7501_30,
|
|
render: () => (0, jsx)(FamilyCenterPrereqMustBeAdultScreen, {})
|
|
};
|
|
r16[FamilyCenterModalRequestSections.SENT] = {
|
|
headerShown: true,
|
|
headerLeft: getHeaderCloseButton(ModalActionCreators.pop),
|
|
headerTitle: () => null,
|
|
render: () => (0, jsx)(FamilyCenterModalRequestSuccess, {})
|
|
};
|
|
r16[FamilyCenterModalRequestSections.ERROR] = {
|
|
headerShown: true,
|
|
headerLeft: getHeaderCloseButton(ModalActionCreators.pop),
|
|
headerTitle: () => null,
|
|
render: (a0) => (0, jsx)(FamilyCenterModalRequestError, {
|
|
failureCode: a0.failureCode
|
|
})
|
|
};
|
|
r16[FamilyCenterModalRequestSections.TEEN_SCAN] = {
|
|
fullscreen: true,
|
|
headerLeft: getHeaderCloseButton(ModalActionCreators.pop),
|
|
render: () => (0, jsx)(FamilyCenterModalRequestError, {
|
|
failureCode: FamilyCenterFailureCode.INELIGIBLE_FOR_FAMILY_CENTER
|
|
})
|
|
};
|
|
return r16;
|
|
}, [linkCode3, userId3]),
|
|
headerBackTitle: intl.string(t["13/7kX"])
|
|
});
|
|
};
|
|
export { FamilyCenterModalRequestSuccess };
|
|
export { FamilyCenterModalRequestError };
|