Files
discord-decomp/sources/modules/premium/powerups/native/GuildPowerupsProgressBar.tsx
T
2026-07-27 16:20:00 +03:00

173 lines
11 KiB
TypeScript

/* Metro module 14689; source: modules/premium/powerups/native/GuildPowerupsProgressBar.tsx; dependencies: [31, 27, 14690, 1867, 33, 697, 4017, 4589, 4501, 632, 14691, 14692, 4504, 14599, 6789, 1244, 2256, 8554, 4573, 6818, 2] */
function _fun110832(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:6, offset: 0x02388c3a, size: 636 bytes, params: 8, frame: 26
var object6;
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 StyleSheet = value.StyleSheet;
const env0_4 = value.View;
const guildBoostingProgressBarPersistedStore = importDefault(14690) /* metro dependency 14690: GuildBoostingProgressBarPersistedStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
value = 2 * PX_4;
const env0_9 = ['rgba(255, 115, 250, 0.4)', 'rgba(255, 115, 250, 0.1)'];
const env0_10 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(importDefault(4589) /* metro dependency 4589 */);
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object6 = {};
const object7 = {};
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object7.paddingVertical = PX_4;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object7.paddingHorizontal = PX_16;
object6.container = object7;
const object8 = {height: 30};
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_MOD_NORMAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_NORMAL;
object8.backgroundColor = BACKGROUND_MOD_NORMAL;
object8.justifyContent = 'center';
object6.track = object8;
const object9 = {};
copyDataProperties(object9, StyleSheet.absoluteFillObject, undefined);
object9['padding'] = 2;
object6.fillContainer = object9;
const object10 = {'height': '100%', 'minWidth': 26, 'borderRadius': null, 'borderWidth': 1,
'borderColor': 'rgba(255, 115, 250, 0.2)', 'overflow': 'hidden'};
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object6.fill = object10;
object6.fillShadow = {'shadowColor': 'rgba(0, 0, 0, 0.14)', 'shadowOffset': null, 'shadowOpacity': 1,
'shadowRadius': 4, 'elevation': 2, shadowOffset: {'width': 0, 'height': 1}};
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object6.textContainer = {'flexDirection': 'row', 'justifyContent': 'space-between', 'alignItems': 'center',
paddingHorizontal: PX_12};
object6.rightContent = {'flexDirection': 'row', 'alignItems': 'center'};
const env0_11 = Reflect.apply(createStyles, createStylesModule, [object6]);
object6 = {code: 'function GuildPowerupsProgressBarTsx1(){const{animatedFillPercent,animatedFillOpacity}=this.__closure;return{width:animatedFillPercent.get()+"%",opacity:animatedFillOpacity.get()};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/native/GuildPowerupsProgressBar.tsx');
exports.default = GuildPowerupsProgressBar;
exports.BOOST_PROGRESS_BAR_HEIGHT = value + 30;
}
function GuildPowerupsProgressBar({guildId}) { // fn#110833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:1340, offset: 0x02388eb6, size: 1296 bytes, params: 2, frame: 32
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let env0_3 = undefined;
const styles = useStyles();
const value3 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([GuildStore],
function() {
return GuildStore.getGuild(guildId);
}, [guildId]);
const value4 = (importDefault(14691) /* metro dependency 14691: useTotalPossibleBoostCount */)(value3);
const value5 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([GuildBoostingProgressBarPersistedStore],
_fun110835, [guildId]);
let r11 = value3?.premiumSubscriberCount ?? 0;
let binding = env0_3;
binding.useEffect(_fun110836, [guildId, value5, r11]);
const r1 = value4 > 0 ? global.Math.min(value5 / value4 * 100, 100) : 0;
env0_3 = r1;
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(r1);
const value10 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(r1 > 0 ? 1 : 0);
binding = env0_3;
binding.useEffect(_fun110837, [value8, value10, r1]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = GuildPowerupsProgressBarV;
closure.__closure = {animatedFillPercent: value8, animatedFillOpacity: value10};
closure.__workletHash = 6718232104000;
closure.__initData = env0_12;
const value11 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value12 = binding.useCallback(_fun110840, [guildId]);
const r18 = value5 >= value4 ? intl.formatToPlainString((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */)['Ehpq+7'],
{appliedBoostCount: value5}) : intl.formatToPlainString((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */)['/rbPDs'],
{appliedBoostCount: value5, maxBoostCount: value4});
const PressableScale = (require(8554) /* metro dependency 8554: native */).PressableScale;
object2 = {accessibilityRole: 'button'};
const string = intl.string;
const NI6Ihe = (importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).NI6Ihe;
object2.accessibilityLabel = Reflect.apply(string, intl, [NI6Ihe]);
object2.onPress = value12;
object2.style = styles.container;
const view = <View style={styles.fillContainer}>{((Component) => <Component style={[styles.fill, styles.fillShadow,
value11]} colors={env0_9} useAngle angle={270} />)(env0_10)}</View>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
r11 = r11 >= value4 ? '' + intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).NI6Ihe) + ' 🎉' : intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).NI6Ihe);
const text = <Text variant="text-xs/semibold" color="text-default">{r11}</Text>;
const text2 = <Text variant="text-xs/semibold" color="text-default" style={{opacity: 0.7}}>{r18}</Text>;
const ChevronSmallRightIcon = (require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
return (
<PressableScale {...object2}>
<View style={styles.track}>
{view}
<View style={styles.textContainer}>
{text}
<View style={styles.rightContent}>
{text2}
<ChevronSmallRightIcon size="sm" color={TEXT_DEFAULT} />
</View>
</View>
</View>
</PressableScale>
);
}
function _fun110835() { // fn#110835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:1505, offset: 0x023893c6, size: 43 bytes, params: 1, frame: 11
const value = environment.__proto__;
return GuildBoostingProgressBarPersistedStore.getCountForGuild(guildId) ?? 0;
}
function _fun110836() { // fn#110836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:1635, offset: 0x023893f1, size: 64 bytes, params: 1, frame: 13
var value2;
var moduleValue;
if (env0_1 !== env0_2) {
value2 = environment.__proto__;
moduleValue = require(14692) /* metro dependency 14692: GuildBoostingProgressBarActionCreators */;
moduleValue.updateGuildPremiumSubscriptionCount(guildId, env0_2);
}
}
function _fun110837() { // fn#110837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:1817, offset: 0x02389431, size: 136 bytes, params: 1, frame: 22
let binding = env0_4;
let set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
let withTiming = timingModule.withTiming;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [env0_3, {duration: 500}])]);
binding = env0_5;
set = binding.set;
const moduleValue2 = timingModule;
withTiming = moduleValue2.withTiming;
const value = 0;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue2, [env0_3 > value ? 1 : value,
{duration: 500}])]);
return _fun110838;
}
function GuildPowerupsProgressBarV() { // fn#110839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:2026, owner: GuildPowerupsProgressBar.v, offset: 0x023894fe, size: 68 bytes, params: 1, frame: 15
const object2 = {};
object2.width = '' + env0_4.get() + '%';
object2.opacity = env0_5.get();
return object2;
}
function _fun110840() { // fn#110840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:2192, offset: 0x02389542, size: 68 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = importDefault(14599) /* metro dependency 14599: openGuildPowerupsModal */;
const object2 = {};
object2.guildId = guildId;
const GUILD_BOOSTING_SIDEBAR_DISPLAY = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).GUILD_BOOSTING_SIDEBAR_DISPLAY;
object2.analyticsLocation = GUILD_BOOSTING_SIDEBAR_DISPLAY;
value(object2);
}
function _fun110838() { // fn#110838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14886:1918, offset: 0x023894b9, size: 69 bytes, params: 1, frame: 16
const value = environment.__proto__.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).cancelAnimation(env1_4);
(require(4017) /* metro dependency 4017: ReanimatedRexport */).cancelAnimation(env1_5);
}