118 lines
7.2 KiB
TypeScript
118 lines
7.2 KiB
TypeScript
/* Metro module 6913; source: modules/lurker_mode/openLurkerLeavePrompt.native.tsx; dependencies: [31, 27, 1379, 1867, 3785, 661, 33, 4497, 6819, 4501, 6914, 4500, 1244, 6915, 1305, 6927, 1314, 6929, 6593, 2] */
|
|
function _fun55035(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7091:6, offset: 0x01373b3a, size: 427 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value.StyleSheet;
|
|
const env0_5 = value.View;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).JoinGuildSources;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
const env0_12 = value.Fragment;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const ImageSizes = (require(6819) /* metro dependency 6819: GuildIcon */).ImageSizes;
|
|
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
|
|
const XLARGE = GuildIconSizes.XLARGE;
|
|
const property = ImageSizes[XLARGE];
|
|
const env0_14 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({headerRoot: {alignItems: 'center'},
|
|
iconWrapper: {width: property, height: property, position: 'relative'}, badgeOverlay: {'position': 'absolute',
|
|
'right': -4, 'bottom': -4, 'marginRight': 0}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/lurker_mode/openLurkerLeavePrompt.native.tsx');
|
|
exports.openLurkerLeavePrompt = openLurkerLeavePrompt;
|
|
}
|
|
|
|
function LurkerLeavePromptModal({guild, onJoin}) { // fn#55036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7091:481, offset: 0x01373ce5, size: 607 bytes, params: 2, frame: 34
|
|
var object2;
|
|
const styles = useStyles();
|
|
const value2 = env0_3.useCallback(_fun55037, [guild.id]);
|
|
const AlertModal = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertModal;
|
|
object2 = {title: guild.name};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const I1yHxc = (require(1244) /* metro dependency 1244: indexNative */).t.I1yHxc;
|
|
object2.content = Reflect.apply(string, intl, [I1yHxc]);
|
|
const GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
|
|
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
|
|
const XLARGE = GuildIconSizes.XLARGE;
|
|
const guildIcon = <GuildIcon guild={guild} size={XLARGE} value={guild.name} />;
|
|
const GuildBadgeV2 = importDefault(6915) /* metro dependency 6915: GuildBadgeV2 */;
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const Sizes = Icon.Sizes;
|
|
const LARGE = Sizes.LARGE;
|
|
object2.header = <View style={styles.headerRoot}><View style={styles.iconWrapper}>{guildIcon}<GuildBadgeV2 guild={guild} size={LARGE} style={StyleSheet.flatten(styles.badgeOverlay)} /></View></View>;
|
|
const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
const AlertActionButton = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton;
|
|
string = intl.string;
|
|
const VJlc0S = (require(1244) /* metro dependency 1244: indexNative */).t.VJlc0S;
|
|
object2.actions = <><AlertActionButton variant="primary" text={Reflect.apply(string, intl,
|
|
[VJlc0S])} onPress={onJoin} /><AlertActionButton variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2vl7qn'])} onPress={value2} /></>;
|
|
return <AlertModal {...object2} />;
|
|
}
|
|
|
|
function openLurkerLeavePrompt(a0, {onLeave}) { // fn#55038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7091:1298, offset: 0x01373f76, size: 192 bytes, params: 3, frame: 19
|
|
var guild;
|
|
const env0_0 = a0;
|
|
const binding = env0_13;
|
|
if (!binding.has(a0)) {
|
|
guild = GuildStore.getGuild(a0);
|
|
if (guild != null) {
|
|
env0_13.add(a0);
|
|
(require(4497) /* metro dependency 4497: useAlertStoreNative */).openAlert('lurker-leave-prompt:' + a0,
|
|
<LurkerLeavePromptModal guild={guild} onJoin={onJoin} />, _fun55040);
|
|
} else {
|
|
onLeave();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun55037() { // fn#55037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7091:560, offset: 0x01373f44, size: 50 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__;
|
|
value = require(6914) /* metro dependency 6914: LurkerPreviewAnalytics */;
|
|
value.trackLeavePromptLeaveClicked(guild.id);
|
|
}
|
|
|
|
function onJoin() { // fn#55039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7091:1494, owner: openLurkerLeavePrompt.onJoin, offset: 0x01374036, size: 261 bytes, params: 1, frame: 20
|
|
var value4;
|
|
var moduleValue;
|
|
const binding = env0_0;
|
|
let value = environment.__proto__;
|
|
const lurkingSourceForGuild = LurkingStore.getLurkingSourceForGuild(binding);
|
|
const value3 = undefined;
|
|
const type = lurkingSourceForGuild == null ? value3 : lurkingSourceForGuild.type;
|
|
const DIRECTORY_ENTRY = JoinGuildSources.DIRECTORY_ENTRY;
|
|
if (type === DIRECTORY_ENTRY) {
|
|
value4 = ChannelStore.getChannel(lurkingSourceForGuild.directoryChannelId);
|
|
if (value4 != null) {
|
|
moduleValue = require(6927) /* metro dependency 6927: HubProgressActionCreators */;
|
|
moduleValue.setHubProgressActionComplete(value4.getGuildId(),
|
|
(require(1314) /* metro dependency 1314: preloaded_user_settings */).HubProgressStep.JOIN_GUILD);
|
|
}
|
|
}
|
|
const lurkerPreviewAnalyticsModule = require(6914) /* metro dependency 6914: LurkerPreviewAnalytics */;
|
|
const trackJoinClicked = lurkerPreviewAnalyticsModule.trackJoinClicked;
|
|
let LEAVE_PROMPT_LURKER = JoinGuildSources.LEAVE_PROMPT_LURKER;
|
|
value = importDefault(6929) /* metro dependency 6929: LurkerPreviewManager */;
|
|
Reflect.apply(trackJoinClicked, lurkerPreviewAnalyticsModule, [binding, LEAVE_PROMPT_LURKER,
|
|
value.hasNavigatedAway(binding)]);
|
|
value = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
|
|
const joinGuild = value.joinGuild;
|
|
LEAVE_PROMPT_LURKER = JoinGuildSources.LEAVE_PROMPT_LURKER;
|
|
Reflect.apply(joinGuild, value, [binding, {source: LEAVE_PROMPT_LURKER}]);
|
|
return value3;
|
|
}
|
|
|
|
function _fun55040() { // fn#55040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7091:1892, offset: 0x0137413b, size: 45 bytes, params: 1, frame: 12
|
|
env1_13.delete(env0_0);
|
|
if (!env0_2) {
|
|
onLeave();
|
|
}
|
|
}
|
|
|