203 lines
13 KiB
TypeScript
203 lines
13 KiB
TypeScript
/* Metro module 13394; source: modules/parent_tools/native/FamilyCenterModalQRCode.tsx; dependencies: [57, 31, 27, 5117, 661, 33, 4501, 697, 8171, 8170, 3856, 1244, 5080, 12624, 44, 4594, 683, 6258, 6259, 1305, 11785, 4573, 2224, 6766, 5278, 9181, 10120, 6261, 4578, 5282, 10121, 2] */
|
|
function _fun101968(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:6, offset: 0x02225af1, size: 563 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(5117) /* metro dependency 5117: FamilyCenterConstants */;
|
|
const env0_6 = value.FamilyCenterAction;
|
|
const env0_7 = value.PLACEHOLDER_QR_CODE_URL;
|
|
const env0_8 = value.QR_CODE_AUTO_HIDE_TIMEOUT;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
const MESSAGE_MENTIONED_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MESSAGE_MENTIONED_BACKGROUND_DEFAULT;
|
|
object2.noticeContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
|
|
'justifyContent': 'center', 'backgroundColor': null, 'padding': 12, 'marginBottom': 24, 'marginHorizontal': -16,
|
|
backgroundColor: MESSAGE_MENTIONED_BACKGROUND_DEFAULT};
|
|
const object4 = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'backgroundColor': null,
|
|
'marginRight': 8, 'width': 18, 'height': 18};
|
|
let STATUS_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_WARNING;
|
|
object4.backgroundColor = STATUS_WARNING;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object2.noticeIconCircle = object4;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.noticeIcon = {'width': 11, 'height': 11, tintColor: BACKGROUND_BASE_LOW};
|
|
STATUS_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_WARNING;
|
|
object2.noticeText = {color: STATUS_WARNING};
|
|
object2.header = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'textAlign': 'center',
|
|
'marginBottom': 16};
|
|
object2.headerText = {marginBottom: 4};
|
|
object2.description = {textAlign: 'center'};
|
|
object2.reminder = {'marginTop': 16, 'textAlign': 'center'};
|
|
object2.qrCode = {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'center', 'alignItems': 'center'};
|
|
const env0_12 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/parent_tools/native/FamilyCenterModalQRCode.tsx');
|
|
exports.default = FamilyCenterModalQRCode;
|
|
}
|
|
|
|
function FamilyCenterModalQRCodeScreen() { // fn#101969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1124, offset: 0x02225d24, size: 1502 bytes, params: 1, frame: 40
|
|
const styles = useStyles();
|
|
const value2 = (importDefault(8171) /* metro dependency 8171: useIsInAdultAgeGroup */)();
|
|
const [property, env0_1] = env0_3(env0_4.useState(false), 2);
|
|
const value5 = (require(8170) /* metro dependency 8170: useUserLinks */).usePendingRequestCount();
|
|
const value6 = env0_4.useRef(value5);
|
|
const value8 = (require(12624) /* metro dependency 12624: useFamilyCenterActions */).useFamilyCenterActions({onError: env0_4.useCallback(_fun101970,
|
|
[])});
|
|
var env0_4 = value8.getLinkCode;
|
|
const isGetLinkCodeLoading = value8.isGetLinkCodeLoading;
|
|
const value9 = (require(8170) /* metro dependency 8170: useUserLinks */).useUserQRLinkUrl();
|
|
(importDefault(44) /* metro dependency 44 */)(!value2, 'FamilyCenterQRCodeModal should only be rendered for teens.');
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
|
|
getLinkCode();
|
|
});
|
|
env0_4.useEffect(_fun101972, [value6, value5]);
|
|
const value10 = env0_4.useCallback(_fun101973, [property]);
|
|
const ModalScreen = (require(6258) /* metro dependency 6258: ModalScreenNative */).ModalScreen;
|
|
const ModalContent = (require(6259) /* metro dependency 6259: ModalContentNative */).ModalContent;
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const view = <View style={styles.noticeIconCircle}><Icon style={styles.noticeIcon} source={importDefault(11785) /* metro dependency 11785 */} /></View>;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const items2 = [<View style={styles.noticeContainer}>{view}<Text style={styles.noticeText} variant="text-sm/semibold">{Reflect.apply(string,
|
|
intl, [(importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).iHYMAz])}</Text></View>];
|
|
string = intl.string;
|
|
const AVTZaN = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).AVTZaN;
|
|
const text = <Text style={styles.headerText} variant="text-lg/bold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
intl, [AVTZaN])}</Text>;
|
|
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
|
const format = intl.format;
|
|
const LyyCsE = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).LyyCsE;
|
|
items2[1] = <View style={styles.header}>{text}<TextWithIOSLinkWorkaround style={styles.description} variant="text-sm/normal" color="text-default">{Reflect.apply(format,
|
|
intl, [LyyCsE,
|
|
{link: 'https://support.discord.com/hc/articles/14155060633623'}])}</TextWithIOSLinkWorkaround></View>;
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
const QRCodeWithOverlay = (require(9181) /* metro dependency 9181: QRCode */).QRCodeWithOverlay;
|
|
const r11 = property ? isGetLinkCodeLoading ? PLACEHOLDER_QR_CODE_URL : value9 ?? PLACEHOLDER_QR_CODE_URL : PLACEHOLDER_QR_CODE_URL;
|
|
const QRCodeOverlaySizes = (require(9181) /* metro dependency 9181: QRCode */).QRCodeOverlaySizes;
|
|
const SIZE_60 = QRCodeOverlaySizes.SIZE_60;
|
|
items2[2] = <PressableOpacity style={styles.qrCode} onPress={value10} activeOpacity={0.6}><QRCodeWithOverlay size={237} text={r11} overlaySize={SIZE_60} blur={!property} /></PressableOpacity>;
|
|
items2[3] = <Text style={styles.reminder} variant="text-xs/semibold" color="text-default">{intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).goDyoe)}</Text>;
|
|
const modalContent = <ModalContent>{items2}</ModalContent>;
|
|
const ModalFooter = (require(10120) /* metro dependency 10120: ModalFooterNative */).ModalFooter;
|
|
const ButtonGroup = (require(6261) /* metro dependency 6261: ButtonGroupNative */).ButtonGroup;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
const defaultImport3 = importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */;
|
|
return (
|
|
<ModalScreen>
|
|
{modalContent}
|
|
<ModalFooter>
|
|
<ButtonGroup>
|
|
<Button
|
|
variant="primary"
|
|
disabled={isGetLinkCodeLoading}
|
|
loading={isGetLinkCodeLoading}
|
|
text={property ? Reflect.apply(string, intl, [defaultImport3.wg2xwQ]) : Reflect.apply(string,
|
|
intl, [defaultImport3['10dX6U']])}
|
|
onPress={value10}
|
|
/>
|
|
<Button
|
|
variant="tertiary"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq)}
|
|
onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop}
|
|
/>
|
|
</ButtonGroup>
|
|
</ModalFooter>
|
|
</ModalScreen>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterModalQRCode() { // fn#101976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3313, offset: 0x02226465, size: 139 bytes, params: 1, frame: 18
|
|
const value2 = env0_4.useMemo(function() {
|
|
return _fun101978();
|
|
}, []);
|
|
const Modal = (require(10121) /* metro dependency 10121: ModalNative */).Modal;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<Modal
|
|
initialRouteName="QR_CODE"
|
|
screens={value2}
|
|
headerBackTitle={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function _fun101970() { // fn#101970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1293, offset: 0x02226302, size: 111 bytes, params: 1, frame: 17
|
|
const value = environment.__proto__;
|
|
const toastUtilsModule = require(3856) /* metro dependency 3856: ToastUtils */;
|
|
const presentFailedToast = toastUtilsModule.presentFailedToast;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const R0RpRX = (require(1244) /* metro dependency 1244: indexNative */).t.R0RpRX;
|
|
Reflect.apply(presentFailedToast, toastUtilsModule, [Reflect.apply(string, intl, [R0RpRX])]);
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
}
|
|
|
|
function _fun101972() { // fn#101972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1614, offset: 0x02226371, size: 59 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (env0_2 > env0_3.current) {
|
|
value = environment.__proto__;
|
|
value = importDefault(5080) /* metro dependency 5080: ModalActionCreators */;
|
|
value.pop();
|
|
}
|
|
}
|
|
|
|
function _fun101973() { // fn#101973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1677, offset: 0x022263ac, size: 60 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var setTimeout;
|
|
env0_1(_fun101974);
|
|
if (!env0_0) {
|
|
setTimeout = global.setTimeout;
|
|
value = environment.__proto__;
|
|
setTimeout(_fun101975, QR_CODE_AUTO_HIDE_TIMEOUT);
|
|
}
|
|
}
|
|
|
|
function _fun101977() { // fn#101977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3365, offset: 0x022264f0, size: 17 bytes, params: 1, frame: 9
|
|
return (() => {
|
|
var object2 = {headerShown: true};
|
|
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop);
|
|
object2.headerTitle = _fun101979;
|
|
object2.render = _fun101980;
|
|
return {QR_CODE: object2};
|
|
})();
|
|
}
|
|
|
|
function _fun101974(a0) { // fn#101974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1685, offset: 0x022263e8, size: 88 bytes, params: 2, frame: 16
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const FAMILY_CENTER_ACTION = AnalyticEvents.FAMILY_CENTER_ACTION;
|
|
Reflect.apply(track, defaultImport, [FAMILY_CENTER_ACTION,
|
|
{action: env1_0 ? FamilyCenterAction.HideQRCode : FamilyCenterAction.RevealQRCode}]);
|
|
return !a0;
|
|
}
|
|
|
|
function _fun101975() { // fn#101975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:1788, offset: 0x02226440, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
}
|
|
|
|
function getScreens_101978() { // fn#101978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3369, offset: 0x02226501, size: 107 bytes, params: 1, frame: 17
|
|
const object = {headerShown: true};
|
|
object.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop);
|
|
object.headerTitle = function() {
|
|
return null;
|
|
};
|
|
object.render = render_101980;
|
|
return {QR_CODE: object};
|
|
}
|
|
|
|
function getScreens_101978Render() { // fn#101980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13584:3505, owner: getScreens_101978.render, offset: 0x0222656c, size: 23 bytes, params: 1, frame: 13
|
|
return <FamilyCenterModalQRCodeScreen />;
|
|
}
|
|
|