143 lines
5.1 KiB
TypeScript
143 lines
5.1 KiB
TypeScript
// Metro module 16348 (f16349).
|
|
import { useMemo, useState, useCallback } from "react";
|
|
import { Keyboard, ScrollView, View } from "react-native";
|
|
import UserRequiredActionStore from "../../../stores/UserRequiredActionStore";
|
|
import { MarketingURLs, UserRequiredActions } from "../../../Constants";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import { showSimpleActionSheet } from "../../action_sheet/native/showSimpleActionSheet";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import AuthenticationActionCreators from "../../../actions/AuthenticationActionCreators";
|
|
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
|
|
import { useNavigatorBackPressHandler } from "../../../design/components/Navigator/native/useNavigatorBackPressHandler.native";
|
|
import { BackPressHandler } from "../../routing/native/useBackPressHandler";
|
|
import { acceptAgreements } from "../../../actions/UserActionCreators";
|
|
import useTrackImpression from "../../app_analytics/useTrackImpression";
|
|
import { ImpressionTypes, ImpressionNames } from "../../../_bundle/Module503";
|
|
import { Text } from "../../../design/components/Text/native/Text";
|
|
import { Button } from "../../../design/components/Button/native/Button.native";
|
|
import TouchableHitBox from "../../../design/void/TouchableHitBox/native/TouchableHitBox";
|
|
import Module8334 from "../../../_bundle/Module8334";
|
|
let useStyles, handleMoreActions;
|
|
const handleTouch = function handleTouch() {
|
|
Keyboard.dismiss();
|
|
};
|
|
handleMoreActions = function handleMoreActions() {
|
|
showSimpleActionSheet({
|
|
key: "NewTermsModalMore",
|
|
options: [{
|
|
label: intl.string(t["2jxGer"]),
|
|
isDestructive: true,
|
|
onPress: () => AuthenticationActionCreators.logout("new_terms_modal")
|
|
}],
|
|
hasIcons: false
|
|
});
|
|
};
|
|
useStyles = createStyles({
|
|
contentContainer: {
|
|
paddingHorizontal: Module712.space.PX_16,
|
|
flexGrow: 1,
|
|
display: "flex",
|
|
alignContent: "center",
|
|
justifyContent: "center"
|
|
},
|
|
scrollView: {
|
|
flex: 1
|
|
},
|
|
container: {
|
|
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
|
|
flex: 1
|
|
},
|
|
description: {
|
|
marginTop: Module712.space.PX_24,
|
|
marginBottom: Module712.space.PX_24
|
|
},
|
|
agreementDescription: {
|
|
marginTop: Module712.space.PX_24
|
|
},
|
|
navbarRight: {
|
|
position: "absolute",
|
|
right: 0,
|
|
tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT
|
|
},
|
|
stickyFooter: {
|
|
paddingHorizontal: Module712.space.PX_16,
|
|
paddingVertical: Module712.space.PX_16,
|
|
marginTop: Module712.space.PX_24,
|
|
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
|
|
borderTopWidth: 1,
|
|
borderTopColor: Module712.colors.BORDER_SUBTLE
|
|
}
|
|
});
|
|
export default function NewTermsModal() {
|
|
let callback;
|
|
const styles = useStyles();
|
|
const safeAreaInsets_native = useSafeAreaInsets_native();
|
|
const { bottom, top } = safeAreaInsets_native;
|
|
const memo = useMemo(() => UserRequiredActionStore.getAction(), []);
|
|
const [loading, setState] = useState(false);
|
|
useNavigatorBackPressHandler(BackPressHandler.minimize);
|
|
callback = useCallback(async () => {
|
|
let c28343_1;
|
|
c28343_1 = void 0;
|
|
setState(true);
|
|
let c31035_0 = await acceptAgreements();
|
|
(0, setState)(c31035_0);
|
|
}, []);
|
|
useTrackImpression({
|
|
type: ImpressionTypes.VIEW,
|
|
name: ImpressionNames.USER_AGREEMENTS,
|
|
properties: {
|
|
required_action: memo
|
|
}
|
|
}, {}, []);
|
|
return memo != null ? <View style={[styles.container, {
|
|
paddingTop: top,
|
|
paddingBottom: bottom
|
|
}]}>
|
|
<ScrollView style={[styles.scrollView]} contentContainerStyle={styles.contentContainer} onTouchStart={handleTouch}>
|
|
<Text maxFontSizeMultiplier={2} variant="heading-xxl/bold">
|
|
{intl.string(t["7glvXu"])}
|
|
</Text>
|
|
<Text variant="text-md/normal" style={styles.description}>
|
|
{intl.format(t.CN0Hvb, {
|
|
url: MarketingURLs.TERMS_SUMMARY
|
|
})}
|
|
</Text>
|
|
<Text variant="text-md/normal">
|
|
{intl.format(t.iw0hFi, {
|
|
url: MarketingURLs.TERMS
|
|
})}
|
|
</Text>
|
|
<Text variant="text-md/normal">
|
|
{intl.format(t["36klnD"], {
|
|
url: MarketingURLs.PAID_TERMS
|
|
})}
|
|
</Text>
|
|
<Text variant="text-md/normal">
|
|
{intl.format(t.TquFBF, {
|
|
url: MarketingURLs.PRIVACY
|
|
})}
|
|
</Text>
|
|
<Text variant="text-md/normal">
|
|
{intl.format(t.ia96Tb, {
|
|
url: MarketingURLs.GUIDELINES
|
|
})}
|
|
</Text>
|
|
<Text variant="text-md/normal" style={styles.agreementDescription}>
|
|
{intl.string(t["+USXQE"])}
|
|
</Text>
|
|
</ScrollView>
|
|
<View style={styles.stickyFooter}>
|
|
<Button loading={loading} onPress={function onPress() {
|
|
if (memo === UserRequiredActions.AGREEMENTS) {
|
|
callback();
|
|
}
|
|
}} text={intl.string(t["+TBKL1"])} />
|
|
</View>
|
|
<TouchableHitBox style={[styles.navbarRight, {
|
|
top
|
|
}]} source={Module8334} color={styles.navbarRight.tintColor} onPress={handleMoreActions} accessibilityRole="button" accessibilityLabel={intl.string(t["UKOtz+"])} />
|
|
</View> : null;
|
|
};
|