85 lines
5.2 KiB
TypeScript
85 lines
5.2 KiB
TypeScript
/* Metro module 10124; source: modules/virtual_currency/native/BalanceWidgetPill.tsx; dependencies: [31, 27, 33, 4501, 4582, 697, 477, 10125, 1244, 10126, 10132, 10133, 2] */
|
|
function _fun79016(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10310:6, offset: 0x01e41609, size: 467 bytes, params: 8, frame: 23
|
|
var object4;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = undefined;
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_2 = (require(27) /* metro dependency 27 */).View;
|
|
const value2 = require(33) /* metro dependency 33 */;
|
|
const env0_3 = value2.jsx;
|
|
const env0_4 = value2.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object4 = {};
|
|
const object5 = {'minHeight': null, 'borderRadius': null, 'justifyContent': 'center', 'alignItems': 'center',
|
|
'flexDirection': 'row'};
|
|
const SMALL_BUTTON_HEIGHT = (require(4582) /* metro dependency 4582: ButtonConstantsNative */).SMALL_BUTTON_HEIGHT;
|
|
object5.minHeight = SMALL_BUTTON_HEIGHT;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.paddingHorizontal = PX_12;
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object5.paddingVertical = PX_4;
|
|
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object5.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
|
|
object5.gap = 4;
|
|
object4.container = object5;
|
|
object4.orbsLottieContainer = {'position': 'relative', 'height': 18, 'width': 18, 'justifyContent': 'center',
|
|
'alignItems': 'center'};
|
|
object4.balanceCounterContainer = {'justifyContent': 'center', 'alignItems': 'flex-end'};
|
|
const object6 = {};
|
|
const CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
|
|
object6.color = CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
|
|
object6.textAlign = 'right';
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
object6.lineHeight = platformUtilsModule.isAndroid() ? 14 : value;
|
|
object4.balanceText = object6;
|
|
const env0_5 = Reflect.apply(createStyles, createStylesModule, [object4]);
|
|
const closure = BalanceWidgetPill;
|
|
closure.displayName = 'BalanceWidgetPill';
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/virtual_currency/native/BalanceWidgetPill.tsx');
|
|
exports.default = closure;
|
|
exports.BalanceWidgetPill = closure;
|
|
return value;
|
|
}
|
|
|
|
function BalanceWidgetPill({initialRenderedBalance, balance}) { // fn#79017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10310:802, offset: 0x01e417dc, size: 467 bytes, params: 2, frame: 31
|
|
initialRenderedBalance = initialRenderedBalance === undefined ? null : initialRenderedBalance;
|
|
const r5 = initialRenderedBalance === null && balance === null;
|
|
const {onValueChange, onValueReached, showInitialRenderedBalance, currentAnimationType,
|
|
lottieRef} = (require(10125) /* metro dependency 10125: useVirtualCurrencyBalanceAnimationData */).useVirtualCurrencyBalanceAnimationData({initialRenderedBalance: initialRenderedBalance,
|
|
balance: balance});
|
|
const styles = useStyles();
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const r4 = r5 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y0WGqP) : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.zPaLL9,
|
|
{balance: balance});
|
|
const object = {busy: r5};
|
|
const OrbLottieAnimation = (require(10126) /* metro dependency 10126: OrbLottieAnimation */).OrbLottieAnimation;
|
|
const view = <View style={styles.orbsLottieContainer}><OrbLottieAnimation ref={lottieRef} animationType={currentAnimationType} /></View>;
|
|
const BalanceCounter = (require(10132) /* metro dependency 10132: BalanceCounter */).BalanceCounter;
|
|
const r14 = showInitialRenderedBalance ? initialRenderedBalance : balance;
|
|
const EXPECTED_ORB_LOTTIE_ANIMATION_DURATION_MS = (require(10133) /* metro dependency 10133: AnimationUtils */).EXPECTED_ORB_LOTTIE_ANIMATION_DURATION_MS;
|
|
return (
|
|
<View
|
|
style={styles.container}
|
|
accessibilityLabel={r4}
|
|
accessibilityState={object}
|
|
accessible
|
|
>
|
|
{view}
|
|
<View style={styles.balanceCounterContainer}>
|
|
<BalanceCounter
|
|
value={r14}
|
|
onValueChange={onValueChange}
|
|
onValueReached={onValueReached}
|
|
targetTotalCounterTime={EXPECTED_ORB_LOTTIE_ANIMATION_DURATION_MS}
|
|
style={styles.balanceText}
|
|
/>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|