103 lines
6.9 KiB
TypeScript
103 lines
6.9 KiB
TypeScript
/* Metro module 13202; source: modules/user_profile/native/ChangeAvatarActionSheet.tsx; dependencies: [31, 27, 1878, 661, 33, 4501, 697, 566, 3802, 6805, 6758, 1244, 7954, 6231, 6238, 7972, 13186, 2] */
|
|
function _fun100749(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13392:6, offset: 0x021f664a, size: 485 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_5 = (require(661) /* metro dependency 661: Constants */).AnalyticsObjects;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
const env0_8 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.nitroWheel = {marginLeft: PX_8};
|
|
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
|
|
object2.sublabel = {color: TEXT_DEFAULT};
|
|
const INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
|
|
object2.label = {'marginBottom': 4, 'color': null, 'alignItems': 'center', 'flexDirection': 'row',
|
|
color: INTERACTIVE_TEXT_ACTIVE};
|
|
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
|
|
object2.remove = {color: TEXT_FEEDBACK_CRITICAL};
|
|
const object3 = {};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.marginTop = PX_12;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.marginBottom = PX_8;
|
|
object2.upsellButton = object3;
|
|
object2.upsellTitleContainer = {'flexDirection': 'row', 'alignItems': 'flex-end'};
|
|
object2.titleWrapper = {flex: 0};
|
|
object2.titleContainer = {justifyContent: 'flex-start'};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/ChangeAvatarActionSheet.tsx');
|
|
exports.default = ChangeAvatarActionSheet;
|
|
}
|
|
|
|
function ChangeAvatarActionSheet({handleUploadAvatarSelect, handleRemoveAvatarSelect, handleUploadGIFAvatarSelect, handleEditAvatarDecorationSelect, showAnimatedAvatarUpsell, showRemoveAvatar}) { // fn#100750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13392:686, offset: 0x021f682f, size: 1395 bytes, params: 2, frame: 42
|
|
var r14;
|
|
var r9;
|
|
var object6;
|
|
const FormLabel = (require(7972) /* metro dependency 7972: native */).FormLabel;
|
|
var jsxRuntimeEnv0_8Binding;
|
|
var FormSubLabel;
|
|
var items4;
|
|
var UserProfileUpsellButton;
|
|
var object18;
|
|
showAnimatedAvatarUpsell = !(showAnimatedAvatarUpsell === undefined) && showAnimatedAvatarUpsell;
|
|
showRemoveAvatar = !(showRemoveAvatar === undefined) && showRemoveAvatar;
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const isPremium2 = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).isPremium(currentUser);
|
|
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const bottomSheetTitleHeader = <BottomSheetTitleHeader title={Reflect.apply(string, intl,
|
|
[t.lqaIxI])} trailing={isPremium2 && ((NitroWheelIcon) => <NitroWheelIcon />)((require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon)} titleWrapperStyle={styles.titleWrapper} titleContainerStyle={styles.titleContainer} />;
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const tableRow = <TableRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['MsUY/S'])} subLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.r5hKOy)} onPress={handleUploadAvatarSelect} />;
|
|
const r15 = handleUploadGIFAvatarSelect != null && !showAnimatedAvatarUpsell && <TableRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['xsC+/y'])} onPress={handleUploadGIFAvatarSelect} />;
|
|
if (showAnimatedAvatarUpsell) {
|
|
var tableRowProps = {label: <View style={styles.upsellTitleContainer}><FormLabel text={intl.string(t.xZ0Wot)} />{((NitroWheelIcon) => <NitroWheelIcon style={styles.nitroWheel} size="sm" />)((require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon)}</View>};
|
|
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
|
|
FormSubLabel = (require(7972) /* metro dependency 7972: native */).FormSubLabel;
|
|
items4 = [<FormSubLabel style={styles.sublabel} numberOfLines={3} text={intl.string(t.L3UPqR)} />];
|
|
var viewBindingProps2 = {style: styles.upsellButton};
|
|
UserProfileUpsellButton = importDefault(13186) /* metro dependency 13186: UserProfileUpsellButton */;
|
|
items4[1] = <View {...viewBindingProps2}><UserProfileUpsellButton analyticsObject={AnalyticsObjects.ANIMATED_AVATAR} label={intl.string(t.mr4K7D)} /></View>;
|
|
tableRowProps.subLabel = <>{items4}</>;
|
|
r14 = <TableRow {...tableRowProps} />;
|
|
} else {
|
|
r14 = showAnimatedAvatarUpsell;
|
|
}
|
|
const r12 = handleEditAvatarDecorationSelect != null && <TableRow label={<View style={styles.upsellTitleContainer}><FormLabel text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.BVcYCx)} /></View>} onPress={handleEditAvatarDecorationSelect} />;
|
|
if (showRemoveAvatar) {
|
|
r9 = <TableRow label={<FormLabel style={[styles.label,
|
|
styles.remove]} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.twB3fz)} />} onPress={handleRemoveAvatarSelect} />;
|
|
} else {
|
|
r9 = showRemoveAvatar;
|
|
}
|
|
return (
|
|
<ActionSheet>
|
|
{bottomSheetTitleHeader}
|
|
<TableRowGroup hasIcons={false}>
|
|
{tableRow}
|
|
{r15}
|
|
{r14}
|
|
{r12}
|
|
{r9}
|
|
</TableRowGroup>
|
|
</ActionSheet>
|
|
);
|
|
}
|
|
|