586 lines
33 KiB
TypeScript
586 lines
33 KiB
TypeScript
/* Metro module 11199; source: modules/polls/native/PollVotesActionSheet.tsx; dependencies: [57, 5, 31, 27, 4502, 6540, 1379, 4814, 1878, 33, 4501, 697, 566, 1423, 6739, 1244, 5278, 4573, 7149, 5321, 8431, 6771, 11200, 9839, 7152, 4617, 3995, 6238, 1305, 9210, 8743, 4017, 4504, 8416, 4048, 4002, 11201, 11202, 6789, 4080, 6275, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import MessageStore from '../../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
|
|
import EmojiStore from '../../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
|
|
import Emoji from '../../emojis/native/Emoji.tsx'; /* Metro dependency 6739 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import UseVoteReactors from '../useVoteReactors.tsx'; /* Metro dependency 11200 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as Module05321Module from '../../../by-id/module-05321.js'; /* Metro dependency 5321 */
|
|
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
|
|
import * as PollsUtilsModule from '../PollsUtils.tsx'; /* Metro dependency 7149 */
|
|
import * as MessageReactionsTypesModule from '../../messages/MessageReactionsTypes.tsx'; /* Metro dependency 7152 */
|
|
import * as FlashListModule from '../../../external/discord_common/js/packages/flash-list/index.jsx'; /* Metro dependency 8416 */
|
|
import * as FormatPollMessageChatDataModule from '../chat/formatPollMessageChatData.tsx'; /* Metro dependency 8431 */
|
|
import * as MessageReactionsContentModule from '../../reactions/native/MessageReactionsContent.tsx'; /* Metro dependency 9839 */
|
|
|
|
function _fun85568(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:6, offset: 0x01f73ad3, size: 728 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {headerText: {'textAlign': 'center', 'paddingHorizontal': 16}, subheaderText: {'textAlign': 'center',
|
|
'marginTop': 2, 'paddingHorizontal': 16}};
|
|
object.answerScroll = {marginTop: 24};
|
|
object.answerScrollContainer = {'gap': 4, 'paddingHorizontal': 16};
|
|
object.answerName = {'marginTop': 16, 'marginHorizontal': 16, 'marginBottom': 8};
|
|
object.list = {paddingHorizontal: 16};
|
|
const object4 = {'padding': 8, 'flexDirection': 'row', 'alignItems': 'center', 'borderRadius': null,
|
|
'maxWidth': 200};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.answerButton = object4;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object.answerSelected = {backgroundColor: BORDER_SUBTLE};
|
|
object.answerEmoji = {marginRight: 8};
|
|
object.answerText = {flexShrink: 1};
|
|
object.emojiText = {fontSize: 16};
|
|
object.emojiImage = {'height': 16, 'width': 16, 'flexShrink': 0};
|
|
object.noResultsContainer = {'flexDirection': 'column', 'alignItems': 'center', 'paddingHorizontal': 16};
|
|
object.noResultsImage = {'marginTop': 32, 'width': 138};
|
|
object.noResultsTitle = {'marginTop': 16, 'textAlign': 'center'};
|
|
object.noResultsSubtitle = {'marginTop': 4, 'textAlign': 'center'};
|
|
const env0_16 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
const env0_17 = ReactModule.forwardRef(_fun85591);
|
|
object = {code: 'function PollVotesActionSheetTsx1(){const{opacity}=this.__closure;return{flex:1,opacity:opacity.get(),marginBottom:32};}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollVotesActionSheet.tsx');
|
|
exports.default = PollVotesActionSheet;
|
|
function PollEmoji({style, emoji}) { // fn#85569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:1085, offset: 0x01f73dab, size: 153 bytes, params: 2, frame: 20
|
|
const styles = useStyles();
|
|
return ((Component) => <Component style={style} src={(FluxModule).useStateFromStores([EmojiStore],
|
|
_fun85570)} name={emoji.name} textEmojiStyle={styles.emojiText} fastImageStyle={styles.emojiImage} />)(Emoji);
|
|
function _fun85570() { // fn#85570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:1168, offset: 0x01f73e44, size: 155 bytes, params: 1, frame: 14
|
|
var r3;
|
|
var value6;
|
|
if (emoji.id != null) {
|
|
r3 = emoji.animated || (EmojiStore.getCustomEmojiById(emoji.id)?.animated ?? EmojiStore.getCustomEmojiById(emoji.id)?.animated != null);
|
|
value6 = environment.__proto__;
|
|
return (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getEmojiURL({id: emoji.id, animated: r3,
|
|
size: 16});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function PollVotesHeader({message, selectedAnswerId, setSelectedAnswerId}) { // fn#85571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2349, offset: 0x01f73edf, size: 621 bytes, params: 2, frame: 32
|
|
var r0;
|
|
const Text = (TextModule).Text;
|
|
var items2;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
var GestureDetector;
|
|
var object2;
|
|
const styles = useStyles();
|
|
const value2 = env0_5Binding.useMemo(_fun85572, [message.reactions]);
|
|
const value4 = env0_5Binding.useRef(null);
|
|
const env0_4 = env0_5Binding.useRef(null);
|
|
var env0_5Binding = env0_5.useRef(false);
|
|
env0_5Binding.useEffect(_fun85573, [selectedAnswerId]);
|
|
const value5 = env0_5Binding.useMemo(_fun85582, []);
|
|
let poll = message.poll;
|
|
if (poll == null) {
|
|
r0 = null;
|
|
} else {
|
|
poll = message.poll;
|
|
items2 = [
|
|
<Text
|
|
style={styles.headerText}
|
|
variant="redesign/heading-18/bold"
|
|
color="mobile-text-heading-primary"
|
|
accessibilityRole="header"
|
|
>
|
|
{poll.question.text}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
<Text
|
|
style={styles.subheaderText}
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
>
|
|
{intl.format(t.XRkuof, {count: value2})}
|
|
</Text>
|
|
);
|
|
GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
|
|
object2 = {gesture: value5};
|
|
var scrollViewProps = {'ref': null, 'style': null, 'contentContainerStyle': null, 'horizontal': true,
|
|
'showsHorizontalScrollIndicator': false, 'accessibilityRole': 'tablist', ref: value4,
|
|
style: styles.answerScroll, contentContainerStyle: styles.answerScrollContainer,
|
|
accessibilityLabel: intl.string(t['qbir+4'])};
|
|
poll = message.poll;
|
|
items2[2] = (
|
|
<GestureDetector {...object2}>
|
|
<ScrollView {...scrollViewProps}>
|
|
{poll.answers.map(_fun85583)}
|
|
</ScrollView>
|
|
</GestureDetector>
|
|
);
|
|
r0 = (
|
|
<View>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
return r0;
|
|
function _fun85572() { // fn#85572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2451, offset: 0x01f7414c, size: 51 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (PollsUtilsModule).getTotalVotes(message.reactions);
|
|
}
|
|
|
|
function _fun85573() { // fn#85573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2569, offset: 0x01f7417f, size: 41 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const setTimeout = global.setTimeout;
|
|
const value = environment.__proto__;
|
|
setTimeout(env1_4(_fun85575), 0);
|
|
function* _fun85575() { // fn#85575, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2588, offset: 0x01f741b3, size: 500 bytes, params: 1, frame: 26
|
|
var environment;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var current = env2_3.current;
|
|
if (current != null) {
|
|
if (env2_4.current == null) {
|
|
return undefined;
|
|
}
|
|
var Promise = global.Promise;
|
|
var prototype = Promise.prototype;
|
|
var value3 = Object.create(prototype, {constructor: {value: Promise}});
|
|
var closure = function(a0) {
|
|
var env0_0 = a0;
|
|
current.measure(_fun85577);
|
|
};
|
|
var promise = new Promise(closure);
|
|
var value4 = promise instanceof Object ? promise : value3;
|
|
Promise = global.Promise;
|
|
prototype = Promise.prototype;
|
|
var value5 = Object.create(prototype, {constructor: {value: Promise}});
|
|
closure = function(a0) {
|
|
var env0_0 = a0;
|
|
current.measure(_fun85579);
|
|
};
|
|
promise = new Promise(closure);
|
|
var value6 = promise instanceof Object ? promise : value5;
|
|
Promise = global.Promise;
|
|
prototype = Promise.prototype;
|
|
var value7 = Object.create(prototype, {constructor: {value: Promise}});
|
|
closure = function(a0) {
|
|
var env0_0 = a0;
|
|
current.measureLayout(current, _fun85581);
|
|
};
|
|
promise = new Promise(closure);
|
|
var value8 = promise instanceof Object ? promise : value7;
|
|
Promise = global.Promise;
|
|
yield Promise.all([value4, value6, value8]);
|
|
var value9 = undefined;
|
|
if (false) {
|
|
return value9;
|
|
}
|
|
var value12 = env3_3(value9, 3);
|
|
var property = value12[0];
|
|
var scrollWidth = property.scrollWidth;
|
|
var scrollPageX = property.scrollPageX;
|
|
property = value12[1];
|
|
var width = property.width;
|
|
var pageX = property.pageX;
|
|
var x = value12[2].x;
|
|
var useReducedMotion = env3_9.useReducedMotion;
|
|
var value13 = !useReducedMotion;
|
|
current = env2_5.current;
|
|
if (current) {
|
|
if (pageX < scrollPageX) {
|
|
current = env2_3.current;
|
|
if (current != null) {
|
|
current.scrollTo({x: x - 16, y: 0, animated: value13});
|
|
}
|
|
} else if (pageX + width > scrollPageX + scrollWidth) {
|
|
current = env2_3.current;
|
|
if (current != null) {
|
|
current.scrollTo({x: x + width - scrollWidth + 16, y: 0, animated: value13});
|
|
}
|
|
}
|
|
return undefined;
|
|
}
|
|
current = env2_3.current;
|
|
if (current != null) {
|
|
current.scrollTo({x: x + width / 2 - scrollWidth / 2, y: 0, animated: value13});
|
|
}
|
|
env2_5.current = true;
|
|
}
|
|
}
|
|
function _fun85576(a0) { // fn#85576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2672, offset: 0x01f743a7, size: 38 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
current.measure(_fun85577);
|
|
function _fun85577(a0, a1, a2, a3, a4) { // fn#85577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2687, offset: 0x01f743cd, size: 34 bytes, params: 6, frame: 11
|
|
return env0_0({scrollWidth: a2, scrollPageX: a4});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun85578(a0) { // fn#85578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2753, offset: 0x01f743ef, size: 38 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
current.measure(_fun85579);
|
|
function _fun85579(a0, a1, a2, a3, a4) { // fn#85579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2768, offset: 0x01f74415, size: 33 bytes, params: 6, frame: 11
|
|
return env0_0({width: a2, pageX: a4});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun85580(a0) { // fn#85580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2822, offset: 0x01f74436, size: 43 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
const currentBinding = current;
|
|
currentBinding.measureLayout(current, _fun85581);
|
|
function _fun85581(a0) { // fn#85581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:2845, offset: 0x01f74461, size: 25 bytes, params: 2, frame: 11
|
|
return env0_0({x: a0});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun85582() { // fn#85582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:3279, offset: 0x01f7447a, size: 56 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
const Gesture = (Module05321Module).Gesture;
|
|
return Gesture.Native().disallowInterruption(true);
|
|
}
|
|
|
|
function _fun85583(a0) { // fn#85583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:3983, offset: 0x01f744b2, size: 159 bytes, params: 2, frame: 21
|
|
const selectedAnswerIdBinding = selectedAnswerId;
|
|
let String = global.String;
|
|
const answer_id = a0.answer_id;
|
|
const value2 = undefined;
|
|
const value3 = selectedAnswerIdBinding === String(answer_id);
|
|
const binding = env1_17;
|
|
const bindingProps = {ref: value3 ? env0_4 : value2, answer: a0, selected: value3};
|
|
const reactionForId = FormatPollMessageChatDataModule.reactionForId;
|
|
const reactions = message.reactions;
|
|
String = global.String;
|
|
bindingProps.reaction = Reflect.apply(reactionForId, FormatPollMessageChatDataModule, [reactions,
|
|
String(a0.answer_id)]);
|
|
bindingProps.setSelectedAnswerId = setSelectedAnswerId;
|
|
return ((Component) => <Component {...bindingProps} key={a0.answer_id} />)(binding);
|
|
}
|
|
|
|
}
|
|
|
|
function VotersList({channelId, messageId, reaction}) { // fn#85584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:4311, offset: 0x01f74551, size: 564 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
|
|
const {reactors,
|
|
hasMore} = (UseVoteReactors)({channelId: channelId,
|
|
messageId: messageId, reaction: reaction});
|
|
const useReactorsOnScrollNative = MessageReactionsContentModule.useReactorsOnScrollNative;
|
|
object = {channelId: channelId, messageId: messageId, reactionSelected: reaction, reactors: reactors,
|
|
reactorsHasMore: hasMore};
|
|
const ReactionTypes = (MessageReactionsTypesModule).ReactionTypes;
|
|
const VOTE = ReactionTypes.VOTE;
|
|
object.reactionType = VOTE;
|
|
const value3 = Reflect.apply(useReactorsOnScrollNative, MessageReactionsContentModule, [object]);
|
|
const value4 = undefined.useCallback(_fun85586,
|
|
[(require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(channelId);
|
|
}), reactors.length, channelId, messageId, analyticsLocations]);
|
|
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(reactors.length !== 0 ? 1 : 0);
|
|
value7.useEffect(_fun85588, [value7, reactors.length]);
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
|
|
const VotersListB2 = VotersListB;
|
|
VotersListB2.__closure = {opacity: value7};
|
|
VotersListB2.__workletHash = 8593850252158;
|
|
VotersListB2.__initData = env0_18;
|
|
const value8 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [VotersListB2]);
|
|
const View = (ReanimatedRexport).View;
|
|
const BottomSheetFlashList = (FlashListModule).BottomSheetFlashList;
|
|
return (
|
|
<View style={value8}>
|
|
<BottomSheetFlashList
|
|
contentContainerStyle={styles.list}
|
|
data={reactors}
|
|
renderItem={value4}
|
|
onScroll={value3}
|
|
estimatedItemSize={79}
|
|
/>
|
|
</View>
|
|
);
|
|
function _fun85586({item, index}) { // fn#85586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:4712, offset: 0x01f7479f, size: 444 bytes, params: 2, frame: 28
|
|
var environment;
|
|
var r8;
|
|
let value = environment.__proto__;
|
|
const r7 = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getNickname(channel?.guild_id,
|
|
channel?.id, item) ?? (importDefault(3995) /* metro dependency 3995: UserUtils */).getGlobalName(item);
|
|
const userTag = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(item);
|
|
const user = UserStore.getUser(item.id);
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
const tableRowProps = {start: index === 0, end: reactors.length - 1 === index};
|
|
const Avatar = (NativeModule).Avatar;
|
|
const guild_id = channel?.guild_id;
|
|
const r13 = user ?? item;
|
|
const AvatarSizes = (NativeModule).AvatarSizes;
|
|
const SMALL = AvatarSizes.SMALL;
|
|
tableRowProps.icon = (
|
|
<Avatar
|
|
guildId={guild_id}
|
|
user={r13}
|
|
size={SMALL}
|
|
/>
|
|
);
|
|
if (r7 != null) {
|
|
r8 = r7;
|
|
} else {
|
|
value = importDefault(9210) /* metro dependency 9210: DiscordTag */;
|
|
value = ((Component) => <Component user={item} />)(value);
|
|
r8 = value;
|
|
}
|
|
tableRowProps.label = r8;
|
|
tableRowProps.subLabel = r7 != null ? userTag : null;
|
|
tableRowProps.onPress = onPress_85587;
|
|
return <TableRow {...tableRowProps} />;
|
|
function onPress_85587() { // fn#85587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:5129, offset: 0x01f7495b, size: 83 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */;
|
|
const itemBinding = item;
|
|
return value({userId: itemBinding.id, localUser: itemBinding, sourceAnalyticsLocations: analyticsLocations,
|
|
channelId: channelId, messageId: messageId});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun85588() { // fn#85588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:5301, offset: 0x01f749ae, size: 100 bytes, params: 1, frame: 15
|
|
var binding;
|
|
var set;
|
|
var value;
|
|
if (reactors.length !== 0) {
|
|
binding = env0_5;
|
|
set = binding.set;
|
|
value = environment.__proto__;
|
|
value = require(4504) /* metro dependency 4504: timing */;
|
|
Reflect.apply(set, binding, [value.withTiming(1, {duration: 200})]);
|
|
} else {
|
|
env0_5.set(0);
|
|
}
|
|
}
|
|
|
|
function VotersListB() { // fn#85589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:5427, owner: VotersList.b, offset: 0x01f74a12, size: 38 bytes, params: 1, frame: 10
|
|
const object = {'flex': 1, 'opacity': null, 'marginBottom': 32};
|
|
object.opacity = env0_5.get();
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function NoResults_85590() { // fn#85590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:5717, offset: 0x01f74a38, size: 393 bytes, params: 1, frame: 26
|
|
const styles = useStyles();
|
|
const items2 = [
|
|
<Image
|
|
style={styles.noResultsImage}
|
|
source={(require(4002) /* metro dependency 4002: shared */).isThemeDark((importDefault(4048) /* metro dependency 4048: useTheme */)()) ? importDefault(11201) /* metro dependency 11201 */ : importDefault(11202) /* metro dependency 11202 */}
|
|
/>,
|
|
];
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
items2[1] = (
|
|
<Text
|
|
style={styles.noResultsTitle}
|
|
variant="heading-md/bold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vhQK3o)}
|
|
</Text>
|
|
);
|
|
items2[2] = (
|
|
<Text
|
|
style={styles.noResultsSubtitle}
|
|
variant="text-sm/semibold"
|
|
color="text-default"
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bwytdh)}
|
|
</Text>
|
|
);
|
|
return (
|
|
<View style={styles.noResultsContainer}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun85591({answer, reaction, selected, setSelectedAnswerId}, a1) { // fn#85591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:1466, offset: 0x01f74bc1, size: 613 bytes, params: 3, frame: 25
|
|
const Text = (TextModule).Text;
|
|
const styles = useStyles();
|
|
const r9 = (reaction == null || reaction.count_details == null ? undefined : reaction.count_details.vote) ?? 0;
|
|
const value5 = env0_5.useCallback(function() {
|
|
var setSelectedAnswerIdBinding = setSelectedAnswerId;
|
|
var String = global.String;
|
|
setSelectedAnswerIdBinding(String(answer.answer_id));
|
|
}, [setSelectedAnswerId, answer.answer_id]);
|
|
const r8 = selected ? 'interactive-text-active' : 'text-default';
|
|
const intl = (IndexNativeModule).intl;
|
|
const value8 = intl.formatToPlainString((IndexNativeModule).t.wqBc7A,
|
|
{numVotes: r9, option: answer.poll_media.text});
|
|
const PressableHighlight = (PressablesModule).PressableHighlight;
|
|
return (
|
|
<PressableHighlight
|
|
ref={a1}
|
|
onPress={value5}
|
|
style={[styles.answerButton, selected ? styles.answerSelected : undefined]}
|
|
accessibilityRole="tab"
|
|
accessibilityState={{selected: selected}}
|
|
accessibilityLabel={value8}
|
|
>
|
|
{
|
|
answer.poll_media.emoji != null
|
|
? (
|
|
<PollEmoji style={styles.answerEmoji} emoji={answer.poll_media.emoji} />
|
|
)
|
|
: null
|
|
}
|
|
{
|
|
answer.poll_media.text != null
|
|
? (
|
|
<Text
|
|
style={styles.answerText}
|
|
variant="text-sm/semibold"
|
|
color={r8}
|
|
lineClamp={1}
|
|
>
|
|
{answer.poll_media.text}
|
|
</Text>
|
|
)
|
|
: null
|
|
}
|
|
<Text
|
|
variant="text-sm/semibold"
|
|
color={r8}
|
|
lineClamp={1}
|
|
>
|
|
{' '}
|
|
{'('}
|
|
{r9.toLocaleString()}
|
|
{')'}
|
|
</Text>
|
|
</PressableHighlight>
|
|
);
|
|
}
|
|
|
|
function PollVotesActionSheet({channelId, messageId, initialAnswerId}) { // fn#85593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:6277, offset: 0x01f74e4d, size: 736 bytes, params: 2, frame: 33
|
|
var r17;
|
|
var r8;
|
|
var AnalyticsLocationProvider;
|
|
var BottomSheet;
|
|
var Text;
|
|
var items3;
|
|
var intl;
|
|
var format;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const defaultImport = UseAnalyticsLocations;
|
|
const POLL_VOTES = (AnalyticsLocation).POLL_VOTES;
|
|
const analyticsLocations = defaultImport(POLL_VOTES).analyticsLocations;
|
|
let [property, property2] = Module00057(env0_5.useState(initialAnswerId), 2);
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [MessageStore];
|
|
const message = Reflect.apply(useStateFromStores, FluxModule, [object, function() {
|
|
return MessageStore.getMessage(channelId, messageId);
|
|
}]);
|
|
const r2 = message != null && message.poll != null;
|
|
env0_5.useEffect(_fun85595, [r2]);
|
|
const value8 = env0_5.useMemo(_fun85596, [message?.reactions, property]);
|
|
if (r2) {
|
|
r17 = message == null || message.poll == null ? undefined : message.poll.answers.find(_fun85597);
|
|
r8 = (value8 == null || value8.count_details == null ? undefined : value8.count_details.vote) ?? 0;
|
|
AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
|
|
object = {value: analyticsLocations};
|
|
BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
var bottomSheetProps = {scrollable: true,
|
|
header: <PollVotesHeader message={message} selectedAnswerId={property} setSelectedAnswerId={property2} />};
|
|
Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
var textProps = {'style': null, 'variant': 'text-sm/semibold', 'color': 'text-default',
|
|
style: styles.answerName};
|
|
items3 = [r17 == null ? undefined : r17.poll_media.text, ' - '];
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['SG/Cyy'];
|
|
items3[2] = Reflect.apply(format, intl, [property, {count: r8}]);
|
|
items2 = [
|
|
<Text {...textProps}>
|
|
{items3}
|
|
</Text>,
|
|
];
|
|
r8 = (
|
|
value8 == null
|
|
? (
|
|
<NoResults_85590 />
|
|
)
|
|
: (
|
|
r8 > 0
|
|
? (
|
|
<VotersList
|
|
channelId={channelId}
|
|
messageId={messageId}
|
|
reaction={value8}
|
|
/>
|
|
)
|
|
: (
|
|
<NoResults_85590 />
|
|
)
|
|
)
|
|
);
|
|
items2[1] = r8;
|
|
return (
|
|
<AnalyticsLocationProvider {...object}>
|
|
<BottomSheet {...bottomSheetProps}>
|
|
{items2}
|
|
</BottomSheet>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
}
|
|
return null;
|
|
function _fun85595() { // fn#85595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:6554, offset: 0x01f7514d, size: 56 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (!Module00005) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
value.hideActionSheet('PollVotesActionSheet');
|
|
}
|
|
}
|
|
|
|
function _fun85596() { // fn#85596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:6635, offset: 0x01f75185, size: 87 bytes, params: 1, frame: 14
|
|
var value3;
|
|
var moduleValue;
|
|
const messageBinding = message;
|
|
const value2 = undefined;
|
|
if ((messageBinding == null ? value2 : message.reactions) != null) {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(8431) /* metro dependency 8431: formatPollMessageChatData */;
|
|
return moduleValue.reactionForId(message.reactions, env0_2);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun85597({answer_id}) { // fn#85597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11385:6830, offset: 0x01f751dc, size: 37 bytes, params: 2, frame: 11
|
|
const String = global.String;
|
|
return String(answer_id) === env0_2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun85568, 11199, [57, 5, 31, 27, 4502, 6540, 1379, 4814, 1878, 33, 4501, 697, 566, 1423, 6739, 1244,
|
|
5278, 4573, 7149, 5321, 8431, 6771, 11200, 9839, 7152, 4617, 3995, 6238, 1305, 9210, 8743, 4017, 4504, 8416,
|
|
4048, 4002, 11201, 11202, 6789, 4080, 6275,
|
|
2]) /* metro module 11199, dependencies: [57, 5, 31, 27, 4502, 6540, 1379, 4814, 1878, 33, 4501, 697, 566, 1423, 6739, 1244, 5278, 4573, 7149, 5321, 8431, 6771, 11200, 9839, 7152, 4617, 3995, 6238, 1305, 9210, 8743, 4017, 4504, 8416, 4048, 4002, 11201, 11202, 6789, 4080, 6275, 2] */;
|