158 lines
9.5 KiB
TypeScript
158 lines
9.5 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] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as NitroWheelIconModule from '../../../design/components/Icon/native/redesign/generated/NitroWheelIcon.tsx'; /* Metro dependency 7954 */
|
|
import * as UseTooltipNativeModule from '../../../design/components/Tooltip/native/useTooltip.native.tsx'; /* Metro dependency 8544 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
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;
|
|
object = {};
|
|
const object2 = {'flexDirection': 'row', 'alignItems': 'center', 'borderRadius': null, 'paddingVertical': 2};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.paddingHorizontal = PX_8;
|
|
object.pillBase = object2;
|
|
const CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
|
|
object.pillDark = {backgroundColor: CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT};
|
|
const BADGE_BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BADGE_BACKGROUND_BRAND;
|
|
object.pillLight = {backgroundColor: BADGE_BACKGROUND_BRAND};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.text = {marginLeft: PX_8, textTransform: 'uppercase'};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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 = (UseTheme)();
|
|
const styles = useStyles();
|
|
const value3 = ReactModule.useRef(null);
|
|
const [property, env0_2] = Module00057(ReactModule.useState(false), 2);
|
|
const intl = (IndexNativeModule).intl;
|
|
const value6 = intl.string((IndexNativeModule).t['L9B+ZZ']);
|
|
const value7 = ReactModule.useCallback(_fun78816, []);
|
|
const useMemo = ReactModule.useMemo;
|
|
(UseTooltipNativeModule).useTooltip(value3, Reflect.apply(useMemo, ReactModule,
|
|
[_fun78817, [tooltipPosition, value6, property, value7]]));
|
|
ReactModule.useEffect(_fun78818, [property]);
|
|
const value9 = ReactModule.useCallback(_fun78821, []);
|
|
const isThemeDark2 = (SharedModule).isThemeDark(value2);
|
|
const r7 = isThemeDark2 ? styles.pillDark : styles.pillLight;
|
|
const r10 = isThemeDark2 ? 'control-overlay-primary-text-default' : 'white';
|
|
const value12 = intl.string((IndexNativeModule).t['1m6qcO']);
|
|
const pressableBindingProps = {ref: value3, onPress: value9, hitSlop: env0_9, accessibilityRole: 'button',
|
|
accessibilityLabel: value12, accessibilityHint: value6, style: [styles.pillBase, r7]};
|
|
const NitroWheelIcon = (NitroWheelIconModule).NitroWheelIcon;
|
|
const nitroWheelIcon = <NitroWheelIcon size="xs" color={r10} />;
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<Pressable {...pressableBindingProps}>
|
|
{nitroWheelIcon}
|
|
<Text
|
|
variant="text-sm/bold"
|
|
color={r10}
|
|
style={styles.text}
|
|
>
|
|
{value12}
|
|
</Text>
|
|
</Pressable>
|
|
);
|
|
function _fun78816() { // fn#78816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:773, offset: 0x016b4188, size: 18 bytes, params: 1, frame: 11
|
|
env0_2(false);
|
|
}
|
|
|
|
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: Module00057, visible: env0_1, onPress: ReactModule};
|
|
}
|
|
|
|
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 _fun78819() { // fn#78819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:928, offset: 0x010d036b, size: 18 bytes, params: 1, frame: 11
|
|
env1_2(false);
|
|
}
|
|
|
|
function _fun78820() { // fn#78820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10275:952, offset: 0x016d7e7e, size: 24 bytes, params: 1, frame: 11
|
|
return global.clearTimeout(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
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;
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
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 = (UseTheme)();
|
|
const styles = useStyles();
|
|
const isThemeDark2 = (SharedModule).isThemeDark(value2);
|
|
const r7 = isThemeDark2 ? styles.pillDark : styles.pillLight;
|
|
const r10 = isThemeDark2 ? 'control-overlay-primary-text-default' : 'white';
|
|
const intl = (IndexNativeModule).intl;
|
|
const value5 = intl.string((IndexNativeModule).t['1m6qcO']);
|
|
const items2 = [styles.pillBase, r7];
|
|
const NitroWheelIcon = (NitroWheelIconModule).NitroWheelIcon;
|
|
const nitroWheelIcon = <NitroWheelIcon size="xs" color={r10} />;
|
|
const Text = (TextModule).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;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun78814, 10089, [57, 31, 27, 33, 4501, 697, 4048, 1244, 8544, 4002, 7954, 4573, 10054, 6517,
|
|
2]) /* metro module 10089, dependencies: [57, 31, 27, 33, 4501, 697, 4048, 1244, 8544, 4002, 7954, 4573, 10054, 6517, 2] */;
|