178 lines
12 KiB
TypeScript
178 lines
12 KiB
TypeScript
/* Metro module 15796; source: modules/nuf/native/components/RedesignDiscoverabilityModal.tsx; dependencies: [31, 27, 11994, 1878, 661, 33, 4501, 697, 5314, 1484, 566, 12001, 676, 15797, 12021, 12014, 480, 12013, 5280, 1244, 2] */
|
|
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import ContactSyncActionCreators from '../../../contact_sync/native/ContactSyncActionCreators.tsx'; /* Metro dependency 12001 */
|
|
import SkipHeaderButton from './SkipHeaderButton.tsx'; /* Metro dependency 12013 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as AnalyticsUtilsModule from '../../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
|
|
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ConstantsIOSModule from '../../../../ConstantsIOS.tsx'; /* Metro dependency 676 */
|
|
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as NavigatorNativeModule from '../../../../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */
|
|
import * as NavigatorConstantsNativeModule from '../../../../design/components/Navigator/native/NavigatorConstants.native.tsx'; /* Metro dependency 5314 */
|
|
import * as ContactSyncModalStoreModule from '../../../contact_sync/native/ContactSyncModalStore.tsx'; /* Metro dependency 11994 */
|
|
import * as NUFActionCreatorsModule from '../NUFActionCreators.tsx'; /* Metro dependency 12021 */
|
|
|
|
function _fun121362(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:6, offset: 0x02545be2, size: 409 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const RedesignDiscoverabilityModal2 = RedesignDiscoverabilityModal;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const ModalAnimation = (ConstantsModule).ModalAnimation;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object.header = {'borderBottomWidth': 0, 'backgroundColor': null, 'shadowColor': 'transparent',
|
|
backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object3 = {'flex': 1, 'backgroundColor': null, 'justifyContent': 'center', 'paddingBottom': 44};
|
|
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object3.backgroundColor = BACKGROUND_BASE_LOW;
|
|
const NAV_BAR_HEIGHT = (NavigatorConstantsNativeModule).NAV_BAR_HEIGHT;
|
|
object3.paddingTop = NAV_BAR_HEIGHT + 32;
|
|
object.container = object3;
|
|
const env0_8 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
const SLIDE_IN_OUT = ModalAnimation.SLIDE_IN_OUT;
|
|
RedesignDiscoverabilityModal2.modalConfig = {animation: SLIDE_IN_OUT};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/nuf/native/components/RedesignDiscoverabilityModal.tsx');
|
|
exports.default = RedesignDiscoverabilityModal2;
|
|
function DiscoverabilityLandingScene_121363({onComplete}) { // fn#121363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:485, offset: 0x02545d7b, size: 247 bytes, params: 2, frame: 22
|
|
const value2 = (UseNavigationNativeModule).useNavigation();
|
|
const value3 = (FluxModule).useStateFromStores([UserStore], _fun121364);
|
|
const value4 = useContactSyncModalStore();
|
|
const allowPhone = value4.allowPhone;
|
|
const allowPhone2 = allowPhone;
|
|
const name = value4.name;
|
|
const allowEmail = value4.allowEmail;
|
|
return ((Component) => <Component onNext={allowPhone2.useCallback(_fun121365, [allowPhone, allowEmail,
|
|
allowPhone || allowEmail, value3, name, value2,
|
|
onComplete])} />)(importDefault(15797) /* metro dependency 15797: RedesignDiscoverabilityLanding */);
|
|
function _fun121364() { // fn#121364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:603, offset: 0x0208ef97, size: 35 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return UserStore.getCurrentUser()?.phone;
|
|
}
|
|
|
|
function _fun121365() { // fn#121365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:737, offset: 0x02545e72, size: 149 bytes, params: 1, frame: 15
|
|
var binding;
|
|
(ContactSyncActionCreators).updateDiscoverability({phone: allowPhone,
|
|
email: allowEmail});
|
|
if (env0_6) {
|
|
if (env0_2 == null) {
|
|
onComplete();
|
|
} else if (allowPhone) {
|
|
if (name == null) {
|
|
binding = env0_1;
|
|
binding.push((require(676) /* metro dependency 676: ConstantsIOS */).DiscoverabilityScenes.NAME);
|
|
} else {
|
|
onComplete();
|
|
}
|
|
} else {
|
|
onComplete();
|
|
}
|
|
} else {
|
|
onComplete();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function DiscoverabilityNameScene_121366({onComplete}) { // fn#121366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:912, offset: 0x02545f07, size: 211 bytes, params: 2, frame: 19
|
|
const styles = useStyles();
|
|
const {name, allowPhone} = useContactSyncModalStore();
|
|
ReactModule.useEffect(function() {
|
|
if (!allowPhone) {
|
|
onComplete();
|
|
}
|
|
}, [allowPhone, onComplete]);
|
|
return (
|
|
<View style={styles.container}>
|
|
{((Component) => <Component onNext={ReactModule.useCallback(_fun121368,
|
|
[onComplete])} loading={false} initialName={name ?? ''} />)(importDefault(12014) /* metro dependency 12014: ContactSyncNameInput */)}
|
|
</View>
|
|
);
|
|
function _fun121368(a0) { // fn#121368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1057, offset: 0x02545ff2, size: 52 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
(NUFActionCreatorsModule).startContactSyncForDiscoverability(a0);
|
|
onComplete();
|
|
}
|
|
|
|
}
|
|
|
|
function RedesignDiscoverabilityModal(a0) { // fn#121369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1219, offset: 0x02546026, size: 206 bytes, params: 2, frame: 20
|
|
const onComplete = a0.route.params.onComplete;
|
|
const styles = useStyles();
|
|
const Navigator = (NavigatorNativeModule).Navigator;
|
|
const useMemo = ReactModule.useMemo;
|
|
const items2 = [onComplete];
|
|
const DiscoverabilityScenes = (ConstantsIOSModule).DiscoverabilityScenes;
|
|
const LANDING = DiscoverabilityScenes.LANDING;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<Navigator
|
|
headerStyle={styles.header}
|
|
screens={Reflect.apply(useMemo, ReactModule, [function() {
|
|
return _fun121371(onComplete ?? _fun121379);
|
|
}, items2])}
|
|
initialRouteName={LANDING}
|
|
headerBackTitle={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
|
|
/>
|
|
);
|
|
function _fun121370() { // fn#121370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1369, offset: 0x025460f4, size: 44 bytes, params: 1, frame: 12
|
|
return getScreens_121371(onComplete ?? (function() {
|
|
}));
|
|
function getScreens_121371(a0) { // fn#121371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1373, offset: 0x02546120, size: 238 bytes, params: 2, frame: 18
|
|
const env0_0 = a0;
|
|
const object = {};
|
|
const DiscoverabilityScenes = (ConstantsIOSModule).DiscoverabilityScenes;
|
|
const LANDING = DiscoverabilityScenes.LANDING;
|
|
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
|
|
let DISCOVERABILITY = ImpressionNames.DISCOVERABILITY;
|
|
object[LANDING] = {'ignoreKeyboard': true, 'impressionName': null, 'fullscreen': true,
|
|
impressionName: DISCOVERABILITY, headerLeft: function() {
|
|
return null;
|
|
}, headerTitle: function() {
|
|
return null;
|
|
}, headerRight: headerRight_121374, render: render_121376};
|
|
const NAME = DiscoverabilityScenes.NAME;
|
|
DISCOVERABILITY = ImpressionNames.DISCOVERABILITY;
|
|
object[NAME] = {'ignoreKeyboard': true, 'impressionName': null, 'fullscreen': true, impressionName: DISCOVERABILITY,
|
|
headerTitle: function() {
|
|
return null;
|
|
}, render: render_121378};
|
|
return object;
|
|
function getScreens_121371HeaderRight(a0) { // fn#121374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1586, owner: getScreens_121371.headerRight, offset: 0x0254620e, size: 74 bytes, params: 2, frame: 15
|
|
var environment;
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
return ((Component) => <Component insideNavigator {...a0} {...{['onPress']: headerRightOnPress_121375}} />)(SkipHeaderButton);
|
|
function headerRightOnPress_121375() { // fn#121375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1633, owner: getScreens_121371.headerRight.onPress, offset: 0x010095e8, size: 18 bytes, params: 1, frame: 11
|
|
return env1_0(true);
|
|
}
|
|
|
|
}
|
|
|
|
function getScreens_121371Render() { // fn#121376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1652, owner: getScreens_121371.render, offset: 0x02546258, size: 35 bytes, params: 1, frame: 13
|
|
return <DiscoverabilityLandingScene_121363 onComplete={env0_0} />;
|
|
}
|
|
|
|
function getScreens_121371Render_121378() { // fn#121378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16004:1858, owner: getScreens_121371.render, offset: 0x0254627b, size: 35 bytes, params: 1, frame: 13
|
|
return <DiscoverabilityNameScene_121366 onComplete={env0_0} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun121379() { // fn#121379, offset: 0x00c37b63, size: 4 bytes, params: 1, frame: 1
|
|
}
|
|
|
|
global.__d(_fun121362, 15796, [31, 27, 11994, 1878, 661, 33, 4501, 697, 5314, 1484, 566, 12001, 676, 15797, 12021,
|
|
12014, 480, 12013, 5280, 1244,
|
|
2]) /* metro module 15796, dependencies: [31, 27, 11994, 1878, 661, 33, 4501, 697, 5314, 1484, 566, 12001, 676, 15797, 12021, 12014, 480, 12013, 5280, 1244, 2] */;
|