decord/source/modules/nuf/native/components/DiscoverabilityModal.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

144 lines
5.4 KiB
TypeScript

// Module ID: 12817
// Function ID: 12818
// Name: DiscoverabilityModal
// Dependencies: [19, 17, 12747, 1371, 1074, 21, 4605, 576, 5732, 1483, 504, 12754, 1093, 12774, 12818, 12767, 1250, 7052, 1114, 2]
// Module 12817 (DiscoverabilityModal)
import nativeDefault from "native" /* 576 */;
import ConstantsIOS from "ConstantsIOS" /* 1093 */;
import util from "util" /* 1114 */;
import discord_common_AnalyticsUtils from "discord_common/AnalyticsUtils" /* 1250 */;
import Navigator from "Navigator" /* 7052 */;
import ContactSyncActionCreatorsDefault from "ContactSyncActionCreators" /* 12754 */;
import ContactSyncNameInputDefault from "ContactSyncNameInput" /* 12767 */;
import NUFActionCreators from "NUFActionCreators" /* 12774 */;
import noop from "module_19" /* 19 */;
import UserStore from "UserStore" /* 1371 */;
require = fn;
function DiscoverabilityLandingScene() {
navigation = navigation(allowPhone[9]).useNavigation();
let obj = navigation(allowPhone[9]);
const tmp = allowPhone;
const items = [UserStore];
const stateFromStores = navigation(allowPhone[10]).useStateFromStores(items, () => {
currentUser = currentUser.getCurrentUser();
let phone;
if (currentUser != null) {
phone = currentUser.phone;
}
return phone;
});
const tmp4 = useContactSyncModalStore();
allowPhone = tmp4.allowPhone;
let allowEmail = tmp4.allowEmail;
let tmp5 = allowPhone;
if (!allowPhone) {
tmp5 = allowEmail;
}
allowEmail = tmp5;
const items1 = [navigation, stateFromStores, allowEmail, allowPhone, tmp5];
const onNext = allowEmail.useCallback(() => {
const result = ContactSyncActionCreatorsDefault.updateDiscoverability({ phone: allowPhone, email: allowEmail });
if (allowEmail) {
if (null != stateFromStores) {
if (tmp2) {
navigation.push(ConstantsIOS.DiscoverabilityScenes.NAME);
}
}
}
const obj2 = { phone: allowPhone, email: allowEmail };
tmp2 = allowPhone;
const result1 = NUFActionCreators.closeDiscoverabilityModal(false);
}, items1);
return jsx(stateFromStores(tmp[14]), { onNext });
}
function DiscoverabilityNameScene() {
const tmp = closure_8();
({ name, allowPhone } = useContactSyncModalStore());
const items = [allowPhone];
const effect = noop.useEffect(() => {
if (!allowPhone) {
const result = NUFActionCreators.closeDiscoverabilityModal(false);
}
}, items);
let obj = { style: tmp.container, children: null };
const callback = noop.useCallback((arg0) => {
const result = allowPhone(12774).startContactSyncForDiscoverability(arg0);
const obj = allowPhone(12774);
const result1 = allowPhone(12774).closeDiscoverabilityModal(false);
}, []);
const obj2 = { onNext: callback, loading: false, initialName: null };
const tmp2 = useContactSyncModalStore();
if (name == null) {
name = "";
}
obj2.initialName = name;
obj.children = jsx(ContactSyncNameInputDefault, { onNext: callback, loading: false, initialName: null });
return <tmp6 style={tmp.container}>{null}</tmp6>;
}
class DiscoverabilityModal {
constructor() {
obj = {
screens: closure_3.useMemo(() => {
const obj = {};
obj[ConstantsIOS.DiscoverabilityScenes.LANDING] = {
ignoreKeyboard: true,
impressionName: discord_common_AnalyticsUtils.ImpressionNames.DISCOVERABILITY,
fullscreen: true,
headerLeft() {
return null;
},
headerTitle() {
return null;
},
render() {
return closure_1_7(closure_1_9, {});
}
};
const obj2 = {
ignoreKeyboard: true,
impressionName: discord_common_AnalyticsUtils.ImpressionNames.DISCOVERABILITY,
fullscreen: true,
headerLeft() {
return null;
},
headerTitle() {
return null;
},
render() {
return closure_1_7(closure_1_9, {});
}
};
obj[ConstantsIOS.DiscoverabilityScenes.NAME] = {
ignoreKeyboard: true,
impressionName: discord_common_AnalyticsUtils.ImpressionNames.DISCOVERABILITY,
fullscreen: true,
headerTitle() {
return null;
},
render() {
return closure_1_7(closure_1_10, {});
}
};
return obj;
}, []),
initialRouteName: closure_0(closure_2[12]).DiscoverabilityScenes.LANDING,
headerBackTitle: null
};
intl = closure_0(closure_2[18]).intl;
obj.headerBackTitle = intl.string(closure_0(closure_2[18]).t["13/7kX"]);
return jsx(closure_0(closure_2[17]).Navigator, obj);
}
}
const View = fn(17).View;
const useContactSyncModalStore = fn(12747).useContactSyncModalStore;
const jsx = fn(21).jsx;
const createStyles = fn(4605);
let obj2 = { container: { flex: 1, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW, justifyContent: "center", paddingBottom: 44, paddingTop: fn(5732).NAV_BAR_HEIGHT + 32 } };
let closure_8 = createStyles.createStyles(obj2);
DiscoverabilityModal.modalConfig = { animation: fn(1074).ModalAnimation.SLIDE_IN_OUT };
const size = fn(2);
let result = size.fileFinishedImporting("modules/nuf/native/components/DiscoverabilityModal.tsx");
export default DiscoverabilityModal;