147 lines
8.7 KiB
TypeScript
147 lines
8.7 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] */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import PremiumUtils from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as TableRowGroupNativeModule from '../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
|
|
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
|
|
import * as BottomSheetTitleHeaderNativeModule from '../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
|
|
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = JsxRuntimeModule;
|
|
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;
|
|
object = {};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.nitroWheel = {marginLeft: PX_8};
|
|
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
|
|
object.sublabel = {color: TEXT_DEFAULT};
|
|
const INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
|
|
object.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;
|
|
object.remove = {color: TEXT_FEEDBACK_CRITICAL};
|
|
const object4 = {};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object4.marginTop = PX_12;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.marginBottom = PX_8;
|
|
object.upsellButton = object4;
|
|
object.upsellTitleContainer = {'flexDirection': 'row', 'alignItems': 'flex-end'};
|
|
object.titleWrapper = {flex: 0};
|
|
object.titleContainer = {justifyContent: 'flex-start'};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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 object;
|
|
const FormLabel = (require(7972) /* metro dependency 7972: native */).FormLabel;
|
|
var jsxRuntimeEnv0_8Binding;
|
|
var FormSubLabel;
|
|
var items4;
|
|
var UserProfileUpsellButton;
|
|
var object2;
|
|
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 = (PremiumUtils).isPremium(currentUser);
|
|
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
|
|
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).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 = (TableRowGroupNativeModule).TableRowGroup;
|
|
const TableRow = (TableRowNativeModule).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>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100749, 13202, [31, 27, 1878, 661, 33, 4501, 697, 566, 3802, 6805, 6758, 1244, 7954, 6231, 6238,
|
|
7972, 13186,
|
|
2]) /* metro module 13202, dependencies: [31, 27, 1878, 661, 33, 4501, 697, 566, 3802, 6805, 6758, 1244, 7954, 6231, 6238, 7972, 13186, 2] */;
|