decord/source/modules/nuf/native/components/DiscoverabilityModal.tsx

145 lines
5.4 KiB
TypeScript
Raw Normal View History

// Module ID: 12876
// Function ID: 12877
// Name: DiscoverabilityModal
// Dependencies: [19, 17, 12806, 1371, 1074, 21, 4636, 576, 5763, 1483, 504, 12813, 1093, 12833, 12877, 12826, 1250, 7103, 1114, 2]
2026-07-20 16:05:17 +00:00
// Module 12876 (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" /* 7103 */;
import ContactSyncActionCreatorsDefault from "ContactSyncActionCreators" /* 12813 */;
import ContactSyncNameInputDefault from "ContactSyncNameInput" /* 12826 */;
import NUFActionCreators from "NUFActionCreators" /* 12833 */;
import noop from "module_19" /* 19 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function DiscoverabilityLandingScene() {
2026-07-23 10:11:24 +00:00
navigation = navigation(allowPhone[9]).useNavigation();
let obj = navigation(allowPhone[9]);
2026-07-29 08:29:29 +00:00
const tmp = allowPhone;
const items = [UserStore];
2026-07-23 10:11:24 +00:00
const stateFromStores = navigation(allowPhone[10]).useStateFromStores(items, () => {
2026-07-29 08:29:29 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
let phone;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
phone = currentUser.phone;
}
return phone;
});
2026-07-29 08:29:29 +00:00
const tmp4 = useContactSyncModalStore();
allowPhone = tmp4.allowPhone;
2026-08-24 06:08:38 +00:00
let allowEmail = tmp4.allowEmail;
2026-07-29 08:29:29 +00:00
let tmp5 = allowPhone;
2026-07-20 16:05:17 +00:00
if (!allowPhone) {
2026-07-29 08:29:29 +00:00
tmp5 = allowEmail;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
allowEmail = tmp5;
2026-07-29 08:29:29 +00:00
const items1 = [navigation, stateFromStores, allowEmail, allowPhone, tmp5];
2026-07-23 10:11:24 +00:00
const onNext = allowEmail.useCallback(() => {
const result = ContactSyncActionCreatorsDefault.updateDiscoverability({ phone: allowPhone, email: allowEmail });
2026-08-24 06:08:38 +00:00
if (allowEmail) {
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
if (tmp2) {
navigation.push(ConstantsIOS.DiscoverabilityScenes.NAME);
2026-07-20 16:05:17 +00:00
}
}
}
const obj2 = { phone: allowPhone, email: allowEmail };
tmp2 = allowPhone;
const result1 = NUFActionCreators.closeDiscoverabilityModal(false);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-29 08:29:29 +00:00
return jsx(stateFromStores(tmp[14]), { onNext });
2026-07-20 16:05:17 +00:00
}
function DiscoverabilityNameScene() {
const tmp = closure_8();
2026-07-20 16:05:17 +00:00
({ name, allowPhone } = useContactSyncModalStore());
const items = [allowPhone];
const effect = noop.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (!allowPhone) {
const result = NUFActionCreators.closeDiscoverabilityModal(false);
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-29 08:29:29 +00:00
let obj = { style: tmp.container, children: null };
const callback = noop.useCallback((arg0) => {
const result = allowPhone(12833).startContactSyncForDiscoverability(arg0);
const obj = allowPhone(12833);
const result1 = allowPhone(12833).closeDiscoverabilityModal(false);
2026-07-20 16:05:17 +00:00
}, []);
const obj2 = { onNext: callback, loading: false, initialName: null };
2026-07-20 16:05:17 +00:00
const tmp2 = useContactSyncModalStore();
2026-07-29 08:29:29 +00:00
if (name == null) {
name = "";
2026-07-20 16:05:17 +00:00
}
obj2.initialName = name;
obj.children = jsx(ContactSyncNameInputDefault, { onNext: callback, loading: false, initialName: null });
return <tmp6 style={tmp.container}>{null}</tmp6>;
2026-07-20 16:05:17 +00:00
}
class DiscoverabilityModal {
constructor() {
2026-08-24 06:08:38 +00:00
obj = {
screens: closure_3.useMemo(() => {
const obj = {};
obj[ConstantsIOS.DiscoverabilityScenes.LANDING] = {
2026-08-24 06:08:38 +00:00
ignoreKeyboard: true,
impressionName: discord_common_AnalyticsUtils.ImpressionNames.DISCOVERABILITY,
2026-08-24 06:08:38 +00:00
fullscreen: true,
headerLeft() {
return null;
},
headerTitle() {
return null;
},
render() {
return closure_1_7(closure_1_9, {});
2026-08-24 06:08:38 +00:00
}
};
const obj2 = {
2026-08-24 06:08:38 +00:00
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,
2026-08-24 06:08:38 +00:00
fullscreen: true,
headerTitle() {
return null;
},
render() {
return closure_1_7(closure_1_10, {});
2026-08-24 06:08:38 +00:00
}
};
return obj;
}, []),
initialRouteName: closure_0(closure_2[12]).DiscoverabilityScenes.LANDING,
2026-08-24 06:08:38 +00:00
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);
2026-07-20 16:05:17 +00:00
}
}
const View = fn(17).View;
const useContactSyncModalStore = fn(12806).useContactSyncModalStore;
const jsx = fn(21).jsx;
const createStyles = fn(4636);
let obj2 = { container: { flex: 1, backgroundColor: nativeDefault.colors.BACKGROUND_BASE_LOW, justifyContent: "center", paddingBottom: 44, paddingTop: fn(5763).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");
2026-07-20 16:05:17 +00:00
export default DiscoverabilityModal;