decord/source/modules/soundboard/native/SoundboardSoundPreviewActionSheet.tsx

148 lines
5.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16389
// Function ID: 16390
2026-07-20 16:05:17 +00:00
// Name: SoundboardSoundPreviewActionSheet
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 1922, 4785, 676, 21, 4668, 712, 500, 589, 7177, 7337, 7342, 6862, 7213, 6968, 11160, 4739, 4750, 9447, 9449, 1236, 10113, 8169, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 16389 (SoundboardSoundPreviewActionSheet)
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import closure_6 from "mergeGuildAvatar" /* 1922 */;
import closure_7 from "handleSoundCreateOrUpdate" /* 4785 */;
import { AnalyticsObjects } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
import set from "set" /* 500 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-05 07:35:12 +00:00
({ View: c4, Image: c5 } = get_ActivityIndicator);
({ jsx: c9, jsxs: c10 } = jsxProd);
createCacheKey = { emoji: null, emojiFastImage: null, emojiText: null, text: null, buttonContainer: null, star: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { marginTop: ThemesDefault.space.PX_16, width: 64, height: 64, alignSelf: "center" };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { width: 128, height: 128 };
2026-07-20 16:05:17 +00:00
let num;
2026-07-23 10:11:24 +00:00
if (set.isIOS()) {
2026-07-20 16:05:17 +00:00
num = 60;
}
2026-07-29 08:29:29 +00:00
createCacheKey[2] = { fontSize: num, lineHeight: 74 };
2026-08-24 06:08:38 +00:00
createCacheKey[3] = { marginTop: ThemesDefault.space.PX_16, alignSelf: "center" };
let obj1 = { marginTop: ThemesDefault.space.PX_16, alignSelf: "center" };
createCacheKey[4] = { gap: ThemesDefault.space.PX_8, marginTop: ThemesDefault.space.PX_24 };
set = { width: 16, height: 16, tintColor: ThemesDefault.colors.TEXT_DEFAULT };
2026-07-29 08:29:29 +00:00
createCacheKey[5] = set;
2026-08-24 06:08:38 +00:00
let closure_11 = createCacheKey.createStyles(createCacheKey);
2026-07-23 10:11:24 +00:00
const result = set.fileFinishedImporting("modules/soundboard/native/SoundboardSoundPreviewActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function SoundboardSoundPreviewActionSheet(channelId) {
channelId = channelId.channelId;
const sound = channelId.sound;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let analyticsLocations;
2026-08-05 07:35:12 +00:00
let isPlayingSound;
2026-07-29 08:29:29 +00:00
let isFavorite;
2026-08-24 06:08:38 +00:00
const tmp = callback();
2026-07-29 08:29:29 +00:00
let obj = channelId(589);
2026-08-24 06:08:38 +00:00
const items = [closure_6];
2026-07-29 08:29:29 +00:00
dependencyMap = obj.useStateFromStores(items, () => {
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
id = currentUser.id;
}
return id;
});
2026-08-24 06:08:38 +00:00
analyticsLocations = sound(7177)().analyticsLocations;
obj1 = channelId(589);
const items1 = [closure_7];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj1.useStateFromStoresObject(items1, () => {
let isUserPlayingSoundsResult = null != closure_2;
if (isUserPlayingSoundsResult) {
2026-08-24 06:08:38 +00:00
isUserPlayingSoundsResult = closure_1_7.isUserPlayingSounds(tmp);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
return { isPlayingSound: isUserPlayingSoundsResult, isFavorite: closure_1_7.isFavoriteSound(sound.soundId) };
2026-07-20 16:05:17 +00:00
});
2026-08-05 07:35:12 +00:00
isPlayingSound = stateFromStoresObject.isPlayingSound;
2026-07-29 08:29:29 +00:00
isFavorite = stateFromStoresObject.isFavorite;
2026-07-20 16:05:17 +00:00
const items2 = [isFavorite, sound, analyticsLocations];
2026-08-05 07:35:12 +00:00
const items3 = [channelId, sound, isPlayingSound];
2026-08-24 06:08:38 +00:00
callback = analyticsLocations.useCallback(() => {
2026-07-20 16:05:17 +00:00
if (isFavorite) {
2026-08-24 06:08:38 +00:00
let tmpResult = tmp(7337);
2026-07-20 16:05:17 +00:00
tmpResult.removeFavoriteSound(sound.soundId);
} else {
2026-08-24 06:08:38 +00:00
tmpResult = tmp(7342);
2026-07-29 08:29:29 +00:00
let obj = { sound: null, location: null };
obj[0] = sound;
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(analyticsLocations);
2026-08-24 06:08:38 +00:00
obj.object = closure_1_8.SOUNDBOARD_SOUND;
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-07-20 16:05:17 +00:00
tmpResult.trackSoundFavorited(obj);
2026-08-24 06:08:38 +00:00
channelId(7337).addFavoriteSound(sound.soundId);
const obj4 = channelId(7337);
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-08-05 07:35:12 +00:00
const callback1 = analyticsLocations.useCallback(() => {
if (!isPlayingSound) {
2026-08-24 06:08:38 +00:00
channelId(7337).playSoundLocally(channelId, sound, channelId(6862).LocalSoundTrigger.SOUNDBOARD);
const obj = channelId(7337);
2026-07-20 16:05:17 +00:00
}
}, items3);
2026-08-24 06:08:38 +00:00
obj = { fastImageStyle: items4, textEmojiStyle: items5, src: sound(11160)(sound, 64), name: null };
2026-07-23 10:11:24 +00:00
items4 = [, ];
2026-07-20 16:05:17 +00:00
({ emoji: arr5[0], emojiFastImage: arr5[1] } = tmp);
2026-07-23 10:11:24 +00:00
items5 = [, ];
2026-07-20 16:05:17 +00:00
({ emoji: arr6[0], emojiText: arr6[1] } = tmp);
2026-07-29 08:29:29 +00:00
let str = sound.emojiName;
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = str;
2026-08-24 06:08:38 +00:00
const items6 = [closure_9(sound(6968), obj), , ];
2026-07-29 08:29:29 +00:00
obj = { style: tmp.text, variant: "heading-lg/extrabold", children: sound.name };
2026-08-24 06:08:38 +00:00
items6[1] = closure_9(channelId(4739).Text, obj);
2026-07-29 08:29:29 +00:00
obj1 = { style: tmp.buttonContainer, children: null };
2026-07-20 16:05:17 +00:00
if (isFavorite) {
2026-08-24 06:08:38 +00:00
let StarOutlineIcon = tmp2(9447).StarIcon;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
StarOutlineIcon = tmp2(9449).StarOutlineIcon;
2026-07-20 16:05:17 +00:00
}
2026-08-05 07:35:12 +00:00
const obj2 = { variant: "primary", icon: closure_9(StarOutlineIcon, obj3), text: null, onPress: null };
2026-07-29 08:29:29 +00:00
const intl = tmp2(1236).intl;
2026-07-20 16:05:17 +00:00
const string = intl.string;
2026-07-29 08:29:29 +00:00
const t = tmp2(1236).t;
2026-07-20 16:05:17 +00:00
if (isFavorite) {
let stringResult = string(t.aBUcp3);
} else {
stringResult = string(t.yZFibY);
}
2026-07-29 08:29:29 +00:00
obj2[2] = stringResult;
obj2[3] = callback;
2026-08-24 06:08:38 +00:00
const items7 = [closure_9(channelId(4750).Button, obj2), ];
2026-08-05 07:35:12 +00:00
if (isPlayingSound) {
let obj4 = { style: null };
obj4[0] = tmp.star;
2026-08-24 06:08:38 +00:00
let tmp8Result = tmp8(tmp2(10113).WaveformIcon, obj4);
2026-08-05 07:35:12 +00:00
} else {
const obj5 = { style: null, source: null };
obj5[0] = tmp.star;
2026-08-24 06:08:38 +00:00
obj5[1] = sound(8169);
2026-08-05 07:35:12 +00:00
tmp8Result = tmp8(isFavorite, obj5);
2026-07-20 16:05:17 +00:00
}
2026-08-05 07:35:12 +00:00
const obj6 = { variant: "secondary", icon: tmp8Result, text: null, onPress: null };
const intl2 = tmp2(1236).intl;
const t2 = tmp2(1236).t;
const obj7 = { startExpanded: true, children: null };
2026-07-29 08:29:29 +00:00
const obj8 = { children: null };
2026-08-05 07:35:12 +00:00
obj6[2] = intl2.string(isPlayingSound ? t2.diasud : t2.Kd4uxG);
obj6[3] = callback1;
2026-08-24 06:08:38 +00:00
items7[1] = closure_9(channelId(4750).Button, obj6);
2026-07-29 08:29:29 +00:00
obj1[1] = items7;
2026-08-05 07:35:12 +00:00
items6[2] = closure_10(isPlayingSound, obj1);
obj8[0] = items6;
obj7[1] = closure_10(isPlayingSound, obj8);
2026-08-24 06:08:38 +00:00
return closure_9(channelId(7213).ActionSheet, obj7);
2026-07-20 16:05:17 +00:00
};