387 lines
22 KiB
TypeScript
387 lines
22 KiB
TypeScript
/* Metro module 11974; source: modules/welcome_screen/native/GuildWelcomeActionSheet.tsx; dependencies: [31, 27, 6540, 1379, 1867, 3784, 11971, 11975, 661, 1881, 482, 33, 4501, 697, 6597, 566, 4805, 1230, 4080, 5475, 1423, 3797, 4573, 1305, 11427, 7972, 694, 11973, 683, 6805, 11976, 1244, 2] */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import UseChannelName from '../../channel/useChannelName.tsx'; /* Metro dependency 4805 */
|
|
import EmojiStore from '../../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
|
|
import TextStyles from '../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */
|
|
import WelcomeScreenStore from '../WelcomeScreenStore.tsx'; /* Metro dependency 11971 */
|
|
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 ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as WelcomeScreenStoreModule from '../WelcomeScreenStore.tsx'; /* Metro dependency 11971 */
|
|
import * as WelcomeScreenConstantsModule from '../WelcomeScreenConstants.tsx'; /* Metro dependency 11975 */
|
|
|
|
function _fun91915(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:6, offset: 0x02076517, size: 835 bytes, params: 8, frame: 31
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.View;
|
|
const env0_5 = value.ScrollView;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_13 = value.AnalyticEvents;
|
|
const Fonts = value.Fonts;
|
|
const env0_14 = value.Routes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_17 = value.jsx;
|
|
const env0_18 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object.container = {'alignItems': 'center', 'justifyContent': 'center', 'paddingHorizontal': 16, 'width': '100%',
|
|
'paddingVertical': 32, backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object3 = {'borderRadius': null, 'width': 64, 'height': 64, 'marginBottom': 16};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.guildIcon = object3;
|
|
const object4 = {};
|
|
let DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
copyDataProperties(object4, TextStyles(DISPLAY_EXTRABOLD, TEXT_SUBTLE, 24), undefined);
|
|
object4['marginBottom'] = 8;
|
|
object4['textAlign'] = 'center';
|
|
object.header = object4;
|
|
const object5 = {};
|
|
DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
copyDataProperties(object5, TextStyles(DISPLAY_EXTRABOLD, MOBILE_TEXT_HEADING_PRIMARY, 24), undefined);
|
|
object.headerGuildName = object5;
|
|
object.guildDescription = {'textAlign': 'center', 'marginBottom': 30};
|
|
const object6 = {};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object6.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object6.marginTop = 8;
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.welcomeChannel = object6;
|
|
object.channelsTitle = {alignSelf: 'flex-start'};
|
|
object.emoji = {'width': 24, 'height': 24};
|
|
const object8 = {padding: 4};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object8.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.placeholderEmojiWrapper = object8;
|
|
const env0_19 = Reflect.apply(createStyles, value, [object]);
|
|
const WelcomeChannelRow2 = WelcomeChannelRow;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/welcome_screen/native/GuildWelcomeActionSheet.tsx');
|
|
exports.default = GuildWelcomeActionSheet;
|
|
exports.WelcomeChannelRow = WelcomeChannelRow2;
|
|
function WelcomeChannelRow({welcomeChannel, trackOptionSelect}) { // fn#91916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:1226, offset: 0x0207685a, size: 863 bytes, params: 2, frame: 29
|
|
var r13;
|
|
var r0;
|
|
var defaultImport2;
|
|
var getByName;
|
|
var defaultImport3;
|
|
var FastImage;
|
|
var defaultImport5;
|
|
const styles = useStyles();
|
|
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(welcomeChannel.channel_id);
|
|
});
|
|
const value2 = (UseChannelName)(channel, true);
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun91918);
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun91919,
|
|
[welcomeChannel.emoji_id]);
|
|
if (channel != null) {
|
|
if (value3) {
|
|
if (value4 != null) {
|
|
FastImage = importDefault(5475) /* metro dependency 5475: FastImage */;
|
|
var defaultImport4Props = {style: styles.emoji};
|
|
defaultImport5 = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
defaultImport4Props.source = {uri: defaultImport5.getEmojiURL({id: value4.id, animated: value4.animated,
|
|
size: EMOJI_URL_BASE_SIZE})};
|
|
defaultImport4Props.resizeMode = 'contain';
|
|
r13 = <FastImage {...defaultImport4Props} />;
|
|
} else if (welcomeChannel.emoji_name == null) {
|
|
r13 = (
|
|
<View style={styles.placeholderEmojiWrapper}>
|
|
{((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.REFRESH_SMALL_16} source={importDefault(11427) /* metro dependency 11427 */} />)((require(1305) /* metro dependency 1305: native */).Icon)}
|
|
</View>
|
|
);
|
|
} else {
|
|
defaultImport2 = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */;
|
|
getByName = defaultImport2.getByName;
|
|
defaultImport3 = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */;
|
|
if (Reflect.apply(getByName, defaultImport2,
|
|
[defaultImport3.convertSurrogateToName(welcomeChannel.emoji_name,
|
|
false)]) != null) {
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
r13 = (
|
|
<Text style={styles.emoji} variant="text-sm/medium">
|
|
{welcomeChannel.emoji_name}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r13 = (
|
|
<View style={styles.placeholderEmojiWrapper}>
|
|
{((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.REFRESH_SMALL_16} source={importDefault(11427) /* metro dependency 11427 */} />)((require(1305) /* metro dependency 1305: native */).Icon)}
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
|
|
r0 = (
|
|
<FormRow
|
|
DEPRECATED_style={styles.welcomeChannel}
|
|
leading={r13}
|
|
label={((Text) => <Text variant="text-sm/semibold" color="interactive-text-active">{welcomeChannel.description}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
subLabel={channel != null
|
|
? ((Text) => <Text variant="text-sm/medium" color="text-default">{value2}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
|
|
: null}
|
|
onPress={ReactModule.useCallback(_fun91920, [channel, trackOptionSelect])}
|
|
trailing={((Arrow) => <Arrow />)((require(7972) /* metro dependency 7972: native */).FormRow.Arrow)}
|
|
/>
|
|
);
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
function _fun91918() { // fn#91918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:1401, offset: 0x02076bb9, size: 51 bytes, params: 1, frame: 14
|
|
return channel != null && PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
}
|
|
|
|
function _fun91919() { // fn#91919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:1475, offset: 0x02076bec, size: 52 bytes, params: 1, frame: 12
|
|
const emoji_id = welcomeChannel.emoji_id;
|
|
const value2 = null;
|
|
return value2 != emoji_id ? EmojiStore.getCustomEmojiById(welcomeChannel.emoji_id) : value2;
|
|
}
|
|
|
|
function _fun91920() { // fn#91920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:1566, offset: 0x02076c20, size: 117 bytes, params: 1, frame: 18
|
|
var value2;
|
|
var moduleValue;
|
|
var transitionTo;
|
|
var CHANNEL;
|
|
let channelBinding = channel;
|
|
if (channelBinding != null) {
|
|
trackOptionSelect();
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
|
transitionTo = moduleValue.transitionTo;
|
|
CHANNEL = Routes.CHANNEL;
|
|
channelBinding = channel;
|
|
Reflect.apply(transitionTo, moduleValue, [Reflect.apply(CHANNEL, Routes, [channelBinding.guild_id,
|
|
channelBinding.id])]);
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function GuildWelcomeActionSheet({guildId, onHide}) { // fn#91921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:2550, offset: 0x02076c95, size: 881 bytes, params: 2, frame: 32
|
|
var r0;
|
|
var ActionSheet;
|
|
var items2;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
var welcome_channels;
|
|
var value;
|
|
const styles = useStyles();
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([WelcomeScreenStore],
|
|
function() {
|
|
var object = {};
|
|
var welcomeScreenStoreBinding = WelcomeScreenStore;
|
|
object.welcomeScreen = welcomeScreenStoreBinding.get(guildId);
|
|
object.fetching = welcomeScreenStoreBinding.isFetching();
|
|
object.hasError = welcomeScreenStoreBinding.hasError();
|
|
return object;
|
|
});
|
|
const welcomeScreen = value2.welcomeScreen;
|
|
const welcomeScreen2 = welcomeScreen;
|
|
const fetching = value2.fetching;
|
|
const hasError = value2.hasError;
|
|
const binding = welcomeScreen2;
|
|
binding.useEffect(_fun91924, [guildId, welcomeScreen]);
|
|
binding.useEffect(_fun91926, [fetching, hasError]);
|
|
binding.useEffect(_fun91927, [guildId, welcomeScreen]);
|
|
binding.useEffect(_fun91929, [welcomeScreen]);
|
|
binding.useEffect(function() {
|
|
var defaultImport = importDefault(dependencyMap[28]);
|
|
var OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
|
|
defaultImport.track(OPEN_MODAL, {type: WELCOME_SCREEN_TYPE, guild_id: guildId});
|
|
}, [guildId]);
|
|
binding.useEffect(function() {
|
|
return _fun91932;
|
|
}, [onHide]);
|
|
const env0_6 = binding.useCallback(_fun91933, [guildId, welcomeScreen]);
|
|
if (guild == null) {
|
|
r0 = null;
|
|
} else if (welcomeScreen == null) {
|
|
r0 = null;
|
|
} else {
|
|
ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
|
|
var scrollViewBindingProps = {contentContainerStyle: styles.container};
|
|
value = importDefault(11976) /* metro dependency 11976: GuildInviteIcon */;
|
|
value = ((Component) => <Component style={styles.guildIcon} guild={guild} size={(importDefault(11976) /* metro dependency 11976: GuildInviteIcon */).Sizes.MEDIUM} textScale={2} />)(value);
|
|
items2 = [value];
|
|
items2[1] = (
|
|
<Text
|
|
style={styles.header}
|
|
variant="heading-xl/extrabold"
|
|
color="text-default"
|
|
>
|
|
{intl.format(t['0aydCN'], {guildName: guild.name, guildNameHook: guildNameHook})}
|
|
</Text>
|
|
);
|
|
items2[2] = (
|
|
<Text
|
|
style={styles.guildDescription}
|
|
variant="text-sm/medium"
|
|
color="text-default"
|
|
>
|
|
{welcomeScreen.description}
|
|
</Text>
|
|
);
|
|
var textProps2 = {'style': null, 'variant': 'eyebrow', 'color': 'text-default', style: styles.channelsTitle};
|
|
value = intl.string(t['haj5+i']);
|
|
items2[3] = (
|
|
<Text {...textProps2}>
|
|
{value.toUpperCase()}
|
|
</Text>
|
|
);
|
|
welcome_channels = welcomeScreen.welcome_channels;
|
|
items2[4] = welcome_channels.map(_fun91936);
|
|
value = (
|
|
<ActionSheet startExpanded>
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
{items2}
|
|
</ScrollView>
|
|
</ActionSheet>
|
|
);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun91924() { // fn#91924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:2847, offset: 0x02077045, size: 62 bytes, params: 1, frame: 11
|
|
var environment;
|
|
var value;
|
|
if (welcomeScreen == null) {
|
|
value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.wait(_fun91925);
|
|
}
|
|
function _fun91925() { // fn#91925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:2876, offset: 0x02077083, size: 45 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(11973) /* metro dependency 11973: WelcomeScreenActionCreators */;
|
|
return value.fetchWelcomeScreen(guildId);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun91926() { // fn#91926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:2935, offset: 0x020770b0, size: 68 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (fetching === false && hasError === true) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
value.hideActionSheet();
|
|
}
|
|
}
|
|
|
|
function _fun91927() { // fn#91927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3005, offset: 0x020770f4, size: 62 bytes, params: 1, frame: 11
|
|
var environment;
|
|
var value;
|
|
if (welcomeScreen != null) {
|
|
value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.wait(_fun91928);
|
|
}
|
|
function _fun91928() { // fn#91928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3034, offset: 0x02077132, size: 45 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(11973) /* metro dependency 11973: WelcomeScreenActionCreators */;
|
|
return value.welcomeScreenViewed(guildId);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun91929() { // fn#91929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3094, offset: 0x0207715f, size: 54 bytes, params: 1, frame: 11
|
|
const welcomeScreenBinding = welcomeScreen;
|
|
const value = environment.__proto__;
|
|
if (welcomeScreenBinding === NO_WELCOME_SCREEN) {
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
}
|
|
}
|
|
|
|
function _fun91931() { // fn#91931, offset: 0x020771da, size: 11 bytes, params: 1, frame: 1
|
|
return function() {
|
|
if (onHide != null) {
|
|
onHide();
|
|
}
|
|
};
|
|
function _fun91932() { // fn#91932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3231, offset: 0x020771e5, size: 27 bytes, params: 1, frame: 10
|
|
if (onHide != null) {
|
|
onHide();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun91933(a0) { // fn#91933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3277, offset: 0x02077200, size: 168 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var value2;
|
|
var defaultImport;
|
|
let welcomeScreenBinding = welcomeScreen;
|
|
if (welcomeScreenBinding != null) {
|
|
var env0_2 = false;
|
|
welcomeScreenBinding = welcomeScreen;
|
|
welcomeScreenBinding.welcome_channels.forEach(_fun91934);
|
|
value2 = environment.__proto__;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.GUILD_WELCOME_SCREEN_OPTION_SELECTED, {index: a0, guild_id: guildId,
|
|
options: [],
|
|
options_channel_ids: [], guild_description: welcomeScreenBinding.description, has_custom_emojis: env0_2});
|
|
}
|
|
function _fun91934({description, channel_id, emoji_id}) { // fn#91934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3340, offset: 0x020772a8, size: 66 bytes, params: 2, frame: 13
|
|
env0_0.push(description);
|
|
env0_1.push(channel_id);
|
|
if (emoji_id == null) {
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function guildNameHook(a0, a1) { // fn#91935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:3959, owner: GuildWelcomeActionSheet.guildNameHook, offset: 0x020772ea, size: 86 bytes, params: 3, frame: 15
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<Text
|
|
style={styles.headerGuildName}
|
|
variant="heading-xl/extrabold"
|
|
color="mobile-text-heading-primary"
|
|
key={a1}
|
|
>
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function _fun91936(a0, a1) { // fn#91936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:4376, offset: 0x02077340, size: 53 bytes, params: 3, frame: 16
|
|
const env0_0 = a1;
|
|
return (
|
|
<WelcomeChannelRow
|
|
welcomeChannel={a0}
|
|
trackOptionSelect={trackOptionSelect}
|
|
key={a1}
|
|
/>
|
|
);
|
|
function trackOptionSelect() { // fn#91937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12160:4439, offset: 0x01376453, size: 23 bytes, params: 1, frame: 11
|
|
return env1_6(require);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun91915, 11974, [31, 27, 6540, 1379, 1867, 3784, 11971, 11975, 661, 1881, 482, 33, 4501, 697, 6597,
|
|
566, 4805, 1230, 4080, 5475, 1423, 3797, 4573, 1305, 11427, 7972, 694, 11973, 683, 6805, 11976, 1244,
|
|
2]) /* metro module 11974, dependencies: [31, 27, 6540, 1379, 1867, 3784, 11971, 11975, 661, 1881, 482, 33, 4501, 697, 6597, 566, 4805, 1230, 4080, 5475, 1423, 3797, 4573, 1305, 11427, 7972, 694, 11973, 683, 6805, 11976, 1244, 2] */;
|