137 lines
7.7 KiB
TypeScript
137 lines
7.7 KiB
TypeScript
/* Metro module 10089; source: modules/collectibles/native/FramesEarlyAccessBadge.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 4048, 1244, 8544, 4002, 7954, 4573, 10054, 6517, 2] */
|
|
function _fun78814(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:6, offset: 0x01e35e74, size: 437 bytes, params: 8, frame: 23
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.Pressable;
|
|
const env0_6 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
const env0_9 = {'top': 14, 'bottom': 14, 'left': 14, 'right': 14};
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object3 = {};
|
|
const object4 = {'flexDirection': 'row', 'alignItems': 'center', 'borderRadius': null, 'paddingVertical': 2};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.paddingHorizontal = PX_8;
|
|
object3.pillBase = object4;
|
|
const CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
|
|
object3.pillDark = {backgroundColor: CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT};
|
|
const BADGE_BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BADGE_BACKGROUND_BRAND;
|
|
object3.pillLight = {backgroundColor: BADGE_BACKGROUND_BRAND};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.text = {marginLeft: PX_8, textTransform: 'uppercase'};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/collectibles/native/FramesEarlyAccessBadge.tsx');
|
|
exports.default = _default_78824;
|
|
}
|
|
|
|
function BadgeWithTooltip({tooltipPosition}) { // fn#78815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:610, offset: 0x01e36029, size: 596 bytes, params: 2, frame: 25
|
|
const value2 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const value3 = binding.useRef(null);
|
|
const [property, env0_2] = env0_3(binding.useState(false), 2);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const value6 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['L9B+ZZ']);
|
|
const value7 = binding.useCallback(_fun78816, []);
|
|
const useMemo = binding.useMemo;
|
|
(require(8544) /* metro dependency 8544: useTooltipNative */).useTooltip(value3, Reflect.apply(useMemo, binding,
|
|
[_fun78817, [tooltipPosition, value6, property, value7]]));
|
|
binding.useEffect(_fun78818, [property]);
|
|
const value9 = binding.useCallback(_fun78821, []);
|
|
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(value2);
|
|
const r7 = isThemeDark2 ? styles.pillDark : styles.pillLight;
|
|
const r10 = isThemeDark2 ? 'control-overlay-primary-text-default' : 'white';
|
|
const value12 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1m6qcO']);
|
|
const pressableBindingProps = {ref: value3, onPress: value9, hitSlop: env0_9, accessibilityRole: 'button',
|
|
accessibilityLabel: value12, accessibilityHint: value6, style: [styles.pillBase, r7]};
|
|
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
|
|
const nitroWheelIcon = <NitroWheelIcon size="xs" color={r10} />;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Pressable {...pressableBindingProps}>
|
|
{nitroWheelIcon}
|
|
<Text
|
|
variant="text-sm/bold"
|
|
color={r10}
|
|
style={styles.text}
|
|
>
|
|
{value12}
|
|
</Text>
|
|
</Pressable>
|
|
);
|
|
}
|
|
|
|
function StaticBadge() { // fn#78823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:1443, offset: 0x01e362f6, size: 303 bytes, params: 1, frame: 22
|
|
const value2 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const styles = useStyles();
|
|
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(value2);
|
|
const r7 = isThemeDark2 ? styles.pillDark : styles.pillLight;
|
|
const r10 = isThemeDark2 ? 'control-overlay-primary-text-default' : 'white';
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const value5 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1m6qcO']);
|
|
const items2 = [styles.pillBase, r7];
|
|
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
|
|
const nitroWheelIcon = <NitroWheelIcon size="xs" color={r10} />;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<View accessibilityLabel={value5} style={items2}>
|
|
{nitroWheelIcon}
|
|
<Text
|
|
variant="text-sm/bold"
|
|
color={r10}
|
|
style={styles.text}
|
|
>
|
|
{value5}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _default_78824({location, tooltipPosition, inheritLayerScope, disablePressable}) { // fn#78824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:1814, offset: 0x01e36425, size: 200 bytes, params: 2, frame: 19
|
|
tooltipPosition = tooltipPosition === undefined ? 'top' : tooltipPosition;
|
|
inheritLayerScope = !(inheritLayerScope === undefined) && inheritLayerScope;
|
|
disablePressable = !(disablePressable === undefined) && disablePressable;
|
|
if ((require(10054) /* metro dependency 10054: useCanPurchaseFrames */).useIsProfileFramesEarlyAccessPhase(location)) {
|
|
if (disablePressable) {
|
|
return <StaticBadge />;
|
|
} else if (inheritLayerScope) {
|
|
return <BadgeWithTooltip tooltipPosition={tooltipPosition} />;
|
|
} else {
|
|
const LayerScope = (require(6517) /* metro dependency 6517: LayerScopeNative */).LayerScope;
|
|
return (
|
|
<LayerScope zIndex={3}>
|
|
<BadgeWithTooltip tooltipPosition={tooltipPosition} />
|
|
</LayerScope>
|
|
);
|
|
}
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
function _fun78817() { // fn#78817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:803, offset: 0x01e3627d, size: 40 bytes, params: 1, frame: 3
|
|
return {position: tooltipPosition, label: env0_3, visible: env0_1, onPress: env0_4};
|
|
}
|
|
|
|
function _fun78818() { // fn#78818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:899, offset: 0x01e362a5, size: 56 bytes, params: 1, frame: 14
|
|
if (env0_1) {
|
|
var env0_0 = global.setTimeout(_fun78819, 3000);
|
|
return _fun78820;
|
|
}
|
|
}
|
|
|
|
function _fun78821() { // fn#78821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:1001, offset: 0x01e362dd, size: 25 bytes, params: 1, frame: 11
|
|
env0_2(function(a0) {
|
|
return !a0;
|
|
});
|
|
}
|
|
|