This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,93 @@
// Metro module 14900 (f14901).
import { useLayoutEffect } from "react";
import { View } from "react-native";
import { HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useWideAuthView from "../../../auth/native/useWideAuthView";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { getHeaderBackButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import { useNavigatorBackPressHandler } from "../../../../design/components/Navigator/native/useNavigatorBackPressHandler.native";
import { intl, t } from "../../../../intl/index.native";
import BackgroundImage from "../../../auth/native/components/atoms/BackgroundImage";
import AuthNavbarPlaceholder from "../../../auth/native/components/atoms/AuthNavbarPlaceholder";
import { ShieldSpotIllustration } from "../../../../design/assets/native";
import AuthHeader from "../../../auth/native/components/atoms/AuthHeader";
import { Text } from "../../../../design/components/Text/native/Text";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles((a0) => ({
container: {
alignItems: "center",
justifyContent: "center",
flex: 1,
padding: 16,
paddingTop: 0,
paddingBottom: a0 ? 80 : 0,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
header: {
marginTop: 16
},
body: {
marginTop: 8,
lineHeight: 20,
textAlign: "center"
},
buttonWrapper: {
width: "100%",
marginTop: 24
}
}));
export default function AgeGateUnderage(props) {
let r96;
const onClose = props.onClose;
let underageMessage = props.underageMessage;
let existingUser = props.existingUser;
if (existingUser === void 0) {
existingUser = false;
}
let c21441_1 = existingUser;
const { fromRegister = false, disableSwipe = false } = props;
let c21441_2 = disableSwipe;
const wideAuthView = useWideAuthView();
const styles = useStyles(wideAuthView);
const navigation = useNavigation();
useLayoutEffect(() => {
navigation.setOptions({
headerLeft: c21441_1 ? () => null : getHeaderBackButton(onClose),
gestureEnabled: !c21441_2
});
}, [onClose, existingUser, navigation, disableSwipe]);
useNavigatorBackPressHandler(() => {
onClose();
return true;
});
const r56 = [wideAuthView ? null : <BackgroundImage />, <AuthNavbarPlaceholder />, <ShieldSpotIllustration />, <AuthHeader style={styles.header}>
{existingUser ? intl.string(t["NR/zrG"]) : intl.string(t.nCB6Ga)}
</AuthHeader>, , ,];
if (fromRegister) {
r96 = intl.string(t.GDQgHL);
} else {
const b0QzXe = t.b0QzXe;
if (underageMessage == null) {
underageMessage = intl.string(t.WqEH4D);
}
r96 = intl.format(b0QzXe, {
underageMessage,
helpURL: HelpdeskUtils.getArticleURL(HelpdeskArticles.AGE_GATE)
});
}
r56[4] = <Text style={styles.body} variant="text-md/medium" color="interactive-text-default">{r96}</Text>;
r56[5] = existingUser ? <>
<Text style={styles.body} variant="text-md/medium" color="interactive-text-default">
{intl.format(t["3axQdB"], {
days: 30
})}
</Text>
<View style={styles.buttonWrapper}>
<Button onPress={onClose} text={intl.string(t.JhDw5o)} grow />
</View>
</> : null;
return <View style={styles.container}>{r56}</View>;
};
@@ -0,0 +1,49 @@
// Metro module 16130 (f16131).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useAgeGateVerifyContent } from "../../AgeGateUtils";
import { useMaybePerformReactiveCheckForSource } from "../../../age_assurance/AgeVerificationUtils";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import { ShieldSpotIllustration } from "../../../../design/assets/native";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import AgeVerificationActionCreators_native from "../../../age_assurance/AgeVerificationActionCreators.native";
import { AgeVerificationModalEntryPoint } from "../../../age_assurance/AgeVerificationAnalyticsUtils";
const useStyles = createStyles({
container: {
padding: Module712.space.PX_16,
flex: 1,
alignItems: "center",
justifyContent: "center",
gap: Module712.space.PX_16
},
header: {
textAlign: "center"
},
body: {
textAlign: "center"
},
buttonWrapper: {
width: "100%"
}
});
export default function AgeGateVerify(props) {
const source = props.source;
const styles = useStyles();
const ageGateVerifyContent = useAgeGateVerifyContent(source);
const { verifyAgreementButtonText, verifyGateDescription, verifyTitle } = ageGateVerifyContent;
useMaybePerformReactiveCheckForSource(source);
return <SafeAreaPaddingView top style={styles.container}>
<ShieldSpotIllustration />
<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{verifyTitle}</Text>
<Text style={styles.body} variant="text-md/medium" color="interactive-text-default">{verifyGateDescription}</Text>
{verifyAgreementButtonText != null && <View style={styles.buttonWrapper}>
<Button text={verifyAgreementButtonText} onPress={function onPress() {
AgeVerificationActionCreators_native.showAgeVerificationGetStartedModal({
entryPoint: AgeVerificationModalEntryPoint.NSFW_AGE_GATE
});
}} grow />
</View>}
</SafeAreaPaddingView>;
};
@@ -0,0 +1,8 @@
// Metro module 9360 (f9361).
const r9 = {
MODAL: 0,
0: "MODAL",
GUILD_SIDEBAR: 1,
1: "GUILD_SIDEBAR"
};
export { r9 as NsfwGateSource };
@@ -0,0 +1,57 @@
// Metro module 16128 (f16129).
import { forwardRef, useRef, useImperativeHandle } from "react";
import { Keyboard } from "react-native";
import Module3771 from "../../../../_bundle/Module3771";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import FreeFormInputGroup from "../../../../design/void/Form/native/FreeFormInputGroup";
import { ClearButtonVisibility } from "../../../../design/void/native";
const r23 = forwardRef(function({ date, onChangeDate, label, style, error }, a1) {
let ref, openDatePicker2;
ref = void 0;
const updateDate2 = function updateDate(a0) {
onChangeDate(a0);
const current = ref.current;
if (current != null) {
current.blur();
}
};
openDatePicker2 = function openDatePicker() {
Keyboard.dismiss();
const r21 = import("../../../../components_native/DatePickerActionSheet");
let startDate = date == null ? void 0 : date.toDate();
if (startDate == null) {
const r29 = Module3771();
r29.set("year", r29.year() - 10);
startDate = r29.toDate();
}
const r38 = Module3771();
r38.set("year", r38.year() - 3);
const r24 = {
onSubmit: updateDate2,
title: label,
startDate,
maximumDate: r38.toDate(),
minimumDate: null,
requireDateChanged: true
};
const r50 = Module3771();
r50.set("year", r50.year() - 100);
r24.minimumDate = r50.toDate();
ActionSheetActionCreators.openLazy(r21, "DatePicker", r24);
};
ref = useRef(null);
useImperativeHandle(a1, () => ({
focus: () => {
openDatePicker2();
}
}));
let r23 = date == null ? void 0 : date.format("L");
if (r23 == null) {
r23 = void 0;
}
const r31 = Module3771();
r31.set("year", r31.year() - 10);
const placeholder = Module3771(r31.toDate()).format("L");
return <FreeFormInputGroup style={style} ref={ref} value={r23 == null ? "" : r23} placeholder={placeholder} returnKeyType="next" textContentType="none" autoCapitalize="none" clearButtonVisibility={ClearButtonVisibility.NEVER} editable={false} forceAccessibleContainer accessibilityLabel={`${label}, ${r23 ?? placeholder}`} onPress={openDatePicker2} label={label} error={error} />;
});
export default r23;
@@ -0,0 +1,218 @@
// Metro module 16127 (f16128).
import { useState, useRef, useEffect } from "react";
import { View } from "react-native";
import UserRequiredActionStore from "../../../../stores/UserRequiredActionStore";
import UserStore from "../../../../stores/UserStore";
import { AgeGateAnalyticAction, AgeGateSource } from "../../AgeGateConstants";
import { ExistingUserAgeGateScreens } from "../ExistingUserAgeGateConstants";
import { AnalyticEvents, HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { intl, t } from "../../../../intl/index.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
import Module38 from "../../../../_bundle/Module38";
import { submitDateOfBirth } from "../../AgeGateActionCreators";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import Module3771 from "../../../../_bundle/Module3771";
import isDateValidDateOfBirth from "../../../auth/native/experiment/isDateValidDateOfBirth";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import { Text } from "../../../../design/components/Text/native/Text";
import DateInput from "./DateInput";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flex: 1,
padding: 16,
alignItems: "center",
justifyContent: "center"
},
header: {
marginBottom: 8,
textAlign: "center"
},
body: {
textAlign: "center",
lineHeight: 20,
marginBottom: 16
},
inputGroup: {
marginBottom: 16,
width: "100%"
},
buttonWrapper: {
width: "100%"
}
});
export default function ExistingUserAgeGate(props) {
let r4, state2, r91, loading, onChangeDate, ref;
let navigation, stateFromStores, c22808_5, state, setState, setState2, stateFromStores2, _submitBirthday2, _submitBirthdayWithAgeConfirmation2;
const { onSuccess, onClose, source } = props;
navigation = void 0;
stateFromStores = void 0;
c22808_5 = void 0;
state = void 0;
setState = void 0;
setState2 = void 0;
stateFromStores2 = void 0;
const submitBirthday2 = function submitBirthday(a0) {
return _submitBirthday2.apply(this, arguments);
};
_submitBirthday2 = function _submitBirthday() {
const r9 = async (c30955_0) => {
let r71;
let c30955_3;
let c30955_4 = 0;
let c31788_0, c31788_1;
L10: {
try {
c31788_0 = void 0;
Module38(c30955_0 != null, "Cannot submit null birthday.");
c31788_0 = false;
c30955_4 = 1;
setState(null);
setState2(true);
await submitDateOfBirth(c30955_0, source);
c30955_4 = 0;
r71 = {
shouldShowError: c31788_0
};
} catch ($e) {
const r31 = $e;
let r7 = r31;
c30955_3 = r31;
if (c30955_4 !== 0) {
while (true) {
try {
const r79 = c30955_3;
c30955_4 = 0;
c31788_1 = r79;
if (c31788_1.body != null && c31788_1.body.date_of_birth != null) {
navigation.push(ExistingUserAgeGateScreens.Blocked, {
onClose: ModalActionCreators.pop,
underageMessage: c31788_1.body.date_of_birth,
existingUser: true
});
} else {
const r86 = c31788_1;
setState((r86 == null ? void 0 : r86.body?.username) != null ? intl.string(t["TGg/2k"]) : c31788_1.message);
(0, setState2)(false);
c31788_0 = true;
}
AnalyticsUtils.track(AnalyticEvents.AGE_GATE_ACTION, {
source,
action: AgeGateAnalyticAction.AGE_GATE_FAILURE
});
r71 = {
shouldShowError: c31788_0
};
break L10;
} catch (r76) {
r7 = r76;
c30955_3 = r76;
if (c30955_4 === 0) {
break;
}
}
}
}
throw r7;
}
}
return r71;
};
_submitBirthday2 = r9;
return r9.apply(this, arguments);
};
_submitBirthdayWithAgeConfirmation2 = function _submitBirthdayWithAgeConfirmation() {
const r9 = async () => {
L12: {
Module38(state != null, "Cannot submit null birthday.");
const age = Module3771().diff(state, "years");
if (age < 18) {
navigation.push(ExistingUserAgeGateScreens.AgeGateConfirm, {
source,
onConfirm: () => submitBirthday2(state),
age
});
break L12;
}
await submitBirthday2(state);
return void 0;
}
};
_submitBirthdayWithAgeConfirmation2 = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
navigation = useNavigation();
stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const { NSFW_CHANNEL, NSFW_VOICE_CHANNEL, FAMILY_CENTER } = AgeGateSource;
const r2 = source === AgeGateSource.NSFW_SERVER || source === AgeGateSource.NSFW_SERVER_INVITE || source === AgeGateSource.NSFW_SERVER_INVITE_EMBED;
L12: {
r4 = source === FAMILY_CENTER;
c22808_5 = r2;
[state, onChangeDate] = useState(null);
let state2;
[state2, setState] = useState(null);
[loading, setState2] = useState(false);
ref = useRef(null);
stateFromStores2 = useStateFromStores([UserRequiredActionStore], () => UserRequiredActionStore.getAction());
useEffect(() => {
if (stateFromStores2 != null && onClose != null) {
onClose();
}
}, [stateFromStores2, onClose]);
useEffect(() => {
if (stateFromStores?.nsfwAllowed === false && c22808_5) {
navigation.push(ExistingUserAgeGateScreens.Pawtect);
} else if (stateFromStores?.nsfwAllowed != null) {
onSuccess();
}
}, [stateFromStores, onSuccess, r2, navigation]);
useEffect(() => {
AnalyticsUtils.track(AnalyticEvents.AGE_GATE_ACTION, {
source,
action: AgeGateAnalyticAction.AGE_GATE_OPEN
});
}, [source]);
if (source !== NSFW_CHANNEL && (source !== NSFW_VOICE_CHANNEL && !r2)) {
if (r4) {
r91 = intl.string(t.mhUrKS);
break L12;
}
r91 = intl.format(t.EcJBEI, {
helpURL: HelpdeskUtils.getArticleURL(HelpdeskArticles.AGE_GATE)
});
} else {
r91 = intl.format(t.n3QjDE, {
helpURL: HelpdeskUtils.getArticleURL(HelpdeskArticles.AGE_GATE)
});
}
}
const r121 = r2 ? intl.string(t["H0SG/g"]) : r4 ? intl.string(t.M7mt7m) : intl.string(t.F8otRo);
const isDateValidDateOfBirth2 = isDateValidDateOfBirth(state);
const r128 = !isDateValidDateOfBirth2;
const error = isDateValidDateOfBirth2 ? state2 : state != null ? intl.string(t.udnqh6) : state2;
const r151 = [<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{r121}</Text>, <Text style={styles.body} variant="text-md/medium" color="interactive-text-default">{r91}</Text>, <DateInput style={styles.inputGroup} ref={ref} label={intl.string(t.xNpFJ6)} date={state} onChangeDate={onChangeDate} error={error} />, ,];
const props2 = {
loading,
disabled: null,
text: null,
onPress: null,
grow: true
};
if (!loading) {
loading = r128;
}
props2.disabled = loading;
props2.text = intl.string(t.PDTjLN);
props2.onPress = function submitBirthdayWithAgeConfirmation() {
return _submitBirthdayWithAgeConfirmation2.apply(this, arguments);
};
r151[3] = <View style={styles.buttonWrapper}>
<Button {...props2} />
</View>;
return <SafeAreaPaddingView top style={styles.container}>{r151}</SafeAreaPaddingView>;
};
@@ -0,0 +1,94 @@
// Metro module 16129 (f16130).
import { useState } from "react";
import { View } from "react-native";
import { HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
padding: 16,
flex: 1,
alignItems: "center",
justifyContent: "center"
},
header: {
textAlign: "center",
marginBottom: 8
},
body: {
textAlign: "center",
lineHeight: 20,
marginBottom: 16
},
buttonWrapper: {
width: "100%"
}
});
export default function ExistingUserAgeGateConfirm(props) {
let navigation, setState;
const { age, onConfirm } = props;
navigation = void 0;
setState = void 0;
let _handleConfirm2 = function _handleConfirm() {
const r9 = async () => {
let c30957_3 = 0;
L12: {
try {
setState(true);
c30957_3 = 1;
if ((await onConfirm()).shouldShowError) {
navigation.pop();
}
c30957_3 = 0;
(0, setState)(false);
} catch ($e) {
let r7 = $e;
if (c30957_3 !== 0) {
while (true) {
try {
c30957_3 = 0;
navigation.pop();
(0, setState)(false);
break L12;
} catch ($e) {
r7 = $e;
if (c30957_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
};
_handleConfirm2 = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
navigation = useNavigation();
let loading;
[loading, setState] = useState(false);
return <SafeAreaPaddingView top style={styles.container}>
<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary">
{intl.format(t.wumolR, {
age
})}
</Text>
<Text style={styles.body} variant="text-md/medium" color="interactive-text-default">
{intl.format(t.n3QjDE, {
helpURL: HelpdeskUtils.getArticleURL(HelpdeskArticles.AGE_GATE)
})}
</Text>
<View style={styles.buttonWrapper}>
<Button loading={loading} disabled={loading} text={intl.string(t["6tahin"])} onPress={function handleConfirm() {
return _handleConfirm2.apply(this, arguments);
}} grow />
</View>
</SafeAreaPaddingView>;
};
@@ -0,0 +1,149 @@
// Metro module 16124 (f16125).
import { useRef, useCallback, useMemo } from "react";
import SelectedGuildStore from "../../../../stores/SelectedGuildStore";
import { AgeGateAnalyticAction, AgeGateSource } from "../../AgeGateConstants";
import { ExistingUserAgeGateScreens } from "../ExistingUserAgeGateConstants";
import { AnalyticEvents } from "../../../../Constants";
import { isIOS } from "../../../../utils/PlatformUtils";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import Module16126 from "../../../../_bundle/Module16126";
import { intl, t } from "../../../../intl/index.native";
import { closeAgeGateModal } from "../../AgeGateModalActionCreators";
import GuildActionCreators from "../../../../actions/GuildActionCreators";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { ImpressionNames } from "../../../../_bundle/Module503";
import { getHeaderBackButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import ExistingUserAgeGate from "./ExistingUserAgeGate";
import ExistingUserAgeGateConfirm from "./ExistingUserAgeGateConfirm";
import AgeGateVerify from "./AgeGateVerify";
import AgeGateUnderage from "./AgeGateUnderage";
import NsfwGateGuild from "./NsfwGateGuild";
import { useShouldAgeVerifyForAgeGate } from "../../AgeGateUtils";
import { useWatchAgeVerificationStatusChange } from "../../../age_assurance/AgeVerificationUtils";
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
let renderHeaderTitle;
const onClose = function onClose() {
closeAgeGateModal();
};
renderHeaderTitle = function renderHeaderTitle() {
return null;
};
export default function ExistingUserAgeGateModal(props) {
const source = props.source;
const shouldAgeVerifyForAgeGate = useShouldAgeVerifyForAgeGate();
const ref = useRef(shouldAgeVerifyForAgeGate);
useWatchAgeVerificationStatusChange(useCallback(() => {
if (ref.current) {
closeAgeGateModal(source);
}
}, [source]));
return <Navigator screens={useMemo(() => {
let r7;
let source2;
let source3;
L14: {
source2 = source;
source3 = source;
if (AgeGateSource.NSFW_SERVER_INVITE !== source && AgeGateSource.NSFW_SERVER_INVITE_EMBED !== source) {
if (AgeGateSource.JOIN_LARGE_GUILD_UNDERAGE !== source && AgeGateSource.ACCESS_LARGE_GUILD_UNDERAGE !== source && AgeGateSource.LARGE_GUILD !== source && AgeGateSource.NSFW_SERVER !== source) {
if (AgeGateSource.NSFW_CHANNEL === source) {
r7 = () => {
const guildId = SelectedGuildStore.getGuildId();
if (guildId != null) {
GuildActionCreators.nsfwReturnToSafety(guildId);
}
closeAgeGateModal(source3);
};
break L14;
}
if (AgeGateSource.NSFW_VOICE_CHANNEL === source) {
r7 = () => {
ModalActionCreators.popAll();
AnalyticsUtils.track(AnalyticEvents.AGE_GATE_ACTION, {
source: source3,
action: AgeGateAnalyticAction.AGE_GATE_CLOSE
});
};
break L14;
}
const FAMILY_CENTER = AgeGateSource.FAMILY_CENTER;
r7 = void 0;
if (FAMILY_CENTER !== source) {
break L14;
}
r7 = () => {
closeAgeGateModal(source3);
};
break L14;
}
r7 = () => {
const guildId = SelectedGuildStore.getGuildId();
if (guildId != null) {
GuildActionCreators.nsfwReturnToSafety(guildId);
}
closeAgeGateModal(source3);
ModalActionCreators.popAll();
};
} else {
r7 = () => {
closeAgeGateModal(source3);
};
}
}
if (r7 == null) {
r7 = () => {};
}
const r23 = {};
r23[ExistingUserAgeGateScreens.AgeGate] = {
fullscreen: true,
impressionName: ImpressionNames.USER_AGE_GATE,
impressionProperties: {
existing_user: true
},
headerLeft: getHeaderBackButton(r7),
headerTitle: renderHeaderTitle,
render: (a0, c28230_0) => <ExistingUserAgeGate onSuccess={source2 === AgeGateSource.NSFW_SERVER_INVITE && isIOS() ? () => {
c28230_0.push(ExistingUserAgeGateScreens.NSFWGateGuild);
ToastActionCreators.open({
key: "AGE_GATE_AGE_VERIFIED",
icon: Module16126,
content: intl.string(t.gUiIGZ)
});
} : () => {
closeAgeGateModal();
ToastActionCreators.open({
key: "AGE_GATE_AGE_VERIFIED",
icon: Module16126,
content: intl.string(t.gUiIGZ)
});
}} onClose={onClose} source={source2} />
};
r23[ExistingUserAgeGateScreens.AgeGateConfirm] = {
fullscreen: true,
headerTitle: renderHeaderTitle,
render: (a0) => <ExistingUserAgeGateConfirm {...a0} source={source2} />
};
r23[ExistingUserAgeGateScreens.Pawtect] = {
fullscreen: true,
headerLeft: getHeaderBackButton(r7),
impressionName: ImpressionNames.USER_AGE_GATE_VERIFY,
headerTitle: renderHeaderTitle,
render: () => <AgeGateVerify source={source2} />
};
r23[ExistingUserAgeGateScreens.Blocked] = {
fullscreen: true,
headerTitle: renderHeaderTitle,
impressionProperties: {
existing_user: true
},
render: (a0) => <AgeGateUnderage {...a0} />
};
r23[ExistingUserAgeGateScreens.NSFWGateGuild] = {
headerTitle: renderHeaderTitle,
headerLeft: getHeaderBackButton(r7),
render: () => <NsfwGateGuild onClose={onClose} />
};
return r23;
}, [source])} initialRouteName={shouldAgeVerifyForAgeGate ? ExistingUserAgeGateScreens.Pawtect : ExistingUserAgeGateScreens.AgeGate} headerBackTitle={intl.string(t["13/7kX"])} />;
};
@@ -0,0 +1,35 @@
// Metro module 11757 (f11758).
import { Image as Image2, View, StyleSheet } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import Module11758 from "../../../../_bundle/Module11758";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
alignItems: "center",
justifyContent: "center"
},
border: {
height: StyleSheet.hairlineWidth,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
description: {
marginTop: 16,
textAlign: "center"
}
});
export default function NsfwGateChat() {
const styles = useStyles();
return <>
<View style={styles.border} />
<View style={styles.container}>
<Image2 source={Module11758} />
<Text style={styles.description} variant="text-md/medium" color="text-muted">
{intl.string(t.W4Qyxr)}
</Text>
</View>
</>;
};
@@ -0,0 +1,64 @@
// Metro module 9359 (f9360).
import { useEffect } from "react";
import { Image as Image2, View } from "react-native";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import UserStore from "../../../../stores/UserStore";
import { NsfwGateSource } from "./Constants";
import { AnalyticEvents, HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { intl, t } from "../../../../intl/index.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { getViewNsfwGuildsOrDefault } from "../../../user_settings/content_and_social/AgeRestrictedContentSettingsUtils";
import BackgroundImage from "../../../auth/native/components/atoms/BackgroundImage";
import Module9361 from "../../../../_bundle/Module9361";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
padding: 16,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
header: {
textAlign: "center",
marginBottom: 8
},
description: {
textAlign: "center",
marginBottom: 16
},
image: {
marginBottom: 16
}
});
export default function NsfwGateGuild(props) {
const { onClose, guildId } = props;
const styles = useStyles();
const r14 = intl.string(t.vAymlG);
const r13 = intl.string(t.Crj6eC);
const r44 = intl.format(t.Z12LNW, {
helpURL: HelpdeskUtils.getArticleURL(HelpdeskArticles.NSFW_GUILD_GUIDELINES)
});
const currentUser = UserStore.getCurrentUser();
useEffect(() => {
AnalyticsUtils.track(AnalyticEvents.GUILD_NSFW_GATE_VIEWED, {
guild_id: guildId,
user_id: currentUser?.id,
is_member: GuildMemberStore.isMember(guildId, currentUser?.id),
is_user_opted_in_to_age_restricted_servers: currentUser?.nsfwAllowed && getViewNsfwGuildsOrDefault(),
source: NsfwGateSource.MODAL
});
}, [guildId, currentUser]);
return <View style={styles.container}>
<BackgroundImage />
<Image2 source={Module9361} style={styles.image} />
<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{r14}</Text>
<Text style={styles.description} variant="text-md/normal" color="text-default">{r13}</Text>
<Text style={styles.description} variant="text-md/normal" color="text-default">{r44}</Text>
<Button onPress={onClose} size="md" text={intl.string(t.gRqiWV)} />
</View>;
};
@@ -0,0 +1,26 @@
// Metro module 13046 (f13047).
import { useMessageRequestPrivacyOption } from "../../../message_request/native/hooks/useMessageRequestPrivacyOption";
import { ActionSheet } from "../../../../design/components/Sheet/native/ActionSheet.native";
import { BottomSheetTitleHeader } from "../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { ActionSheetRow } from "../../../../design/components/Sheet/native/ActionSheetRow.native";
import { intl, t } from "../../../../intl/index.native";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { RestrictedGuildPrivacyOption, handleLeaveServer } from "../../../guild_action_sheet/native/components/GuildActionSheetActions";
export default function NsfwGateGuildSettingsActionSheet(props) {
const guild = props.guild;
const messageRequestPrivacyOption = useMessageRequestPrivacyOption({
guild
});
return <ActionSheet header={<BottomSheetTitleHeader title={guild.name} />}>
<ActionSheetRow.Group hasIcons={false}>
<ActionSheetRow label={intl.string(t.h850Ss)} onPress={() => {
ActionSheetActionCreators.hideActionSheet();
NotificationSettingsModalActionCreators.open(guild.id);
}} />
<RestrictedGuildPrivacyOption guild={guild} />
{messageRequestPrivacyOption}
<ActionSheetRow variant="danger" label={intl.string(t.J2TBi3)} onPress={() => handleLeaveServer(guild)} />
</ActionSheetRow.Group>
</ActionSheet>;
};
@@ -0,0 +1,56 @@
// Metro module 15238 (f15239).
import { useEffect } from "react";
import { View } from "react-native";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import GuildStore from "../../../../stores/GuildStore";
import UserStore from "../../../../stores/UserStore";
import { NsfwGateSource } from "./Constants";
import { AnalyticEvents, Fonts, HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { getViewNsfwGuildsOrDefault } from "../../../user_settings/content_and_social/AgeRestrictedContentSettingsUtils";
import ChannelListStickyHeader from "../../../channel_list_v2/native/components/ChannelListStickyHeader";
import { RefreshEmptyState } from "../../../../design/void/native";
import TextStyles from "../../../rebrand/native/TextStyles";
import Module15239 from "../../../../_bundle/Module15239";
import { intl, t } from "../../../../intl/index.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.PANEL_BG
},
emptyStateContainer: {
flex: 1
},
emptyStateImageContainer: {
marginBottom: 16
}
});
export default function NsfwGateGuildSidebar(props) {
let currentUser;
const { style, guildId } = props;
currentUser = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuild(guildId));
currentUser = UserStore.getCurrentUser();
useEffect(() => {
if (currentUser != null && stateFromStores != null) {
AnalyticsUtils.track(AnalyticEvents.GUILD_NSFW_GATE_VIEWED, {
guild_id: guildId,
user_id: currentUser.id,
is_member: GuildMemberStore.isMember(guildId, currentUser.id),
is_user_opted_in_to_age_restricted_servers: currentUser.nsfwAllowed && getViewNsfwGuildsOrDefault(),
source: NsfwGateSource.GUILD_SIDEBAR
});
}
}, [guildId, stateFromStores, currentUser]);
return stateFromStores != null ? <View style={[styles.container, style]}>
<ChannelListStickyHeader guild={stateFromStores} showExtraButtons={false} />
<RefreshEmptyState imageStyle={styles.emptyStateImageContainer} titleStyle={TextStyles(Fonts.DISPLAY_EXTRABOLD, void 0, 16)} containerStyle={styles.emptyStateContainer} source={Module15239} title={intl.string(t.bAVpRR)} body={intl.format(t.NQuXf0, {
helpURL: HelpdeskUtils.getArticleURL(HelpdeskArticles.NSFW_GUILD_GUIDELINES)
})} />
</View> : null;
};