203 lines
11 KiB
TypeScript
203 lines
11 KiB
TypeScript
/* Metro module 15795; source: modules/avatar/native/components/RedesignAddAvatarModal.tsx; dependencies: [5, 57, 31, 27, 7624, 661, 33, 4501, 697, 1585, 566, 8403, 15780, 8421, 4660, 8400, 8402, 4573, 1244, 15789, 4578, 15777, 2] */
|
|
function _fun121353(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16003:6, offset: 0x025453a4, size: 494 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_6 = value.View;
|
|
const env0_7 = value.ScrollView;
|
|
const userProfileSettingsStore = importDefault(7624) /* metro dependency 7624: UserProfileSettingsStore */;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).UPLOAD_MEDIUM_SIZE;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
|
|
object2.contentContainer = {'flexGrow': 2, 'alignItems': 'center'};
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.growContainer = {flexGrow: 2, minHeight: PX_24};
|
|
object2.headerContainer = {'display': 'flex', 'alignItems': 'center'};
|
|
object2.buttonContainer = {width: '100%'};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.title = {marginBottom: PX_8, textAlign: 'center'};
|
|
object2.subtitle = {textAlign: 'center'};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.errorContainer = {alignSelf: 'center', paddingTop: PX_24};
|
|
const env0_12 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/avatar/native/components/RedesignAddAvatarModal.tsx');
|
|
exports.default = RedesignAddAvatarModal;
|
|
}
|
|
|
|
function RedesignAddAvatarModal(a0) { // fn#121354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16003:773, offset: 0x02545592, size: 1138 bytes, params: 2, frame: 37
|
|
var r0;
|
|
var moduleValue2;
|
|
var createPendingImage;
|
|
const env0_0 = a0.route.params.onComplete;
|
|
const value = undefined;
|
|
const env0_4 = value;
|
|
const styles = useStyles();
|
|
const binding = env0_5;
|
|
let useState = binding.useState;
|
|
const value3 = Reflect.apply(useState, binding, [false]);
|
|
const binding2 = env0_4;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const env0_1 = value4[1];
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, []), 2);
|
|
const property2 = value5[0];
|
|
const property3 = value5[1];
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStores = fluxModule.useStateFromStores;
|
|
let object = [UserProfileSettingsStore];
|
|
const pendingAvatar = Reflect.apply(useStateFromStores, fluxModule, [object, function() {
|
|
return UserProfileSettingsStore.getPendingChanges().pendingAvatar;
|
|
}]);
|
|
if (property2 != null) {
|
|
moduleValue2 = require(8403) /* metro dependency 8403: RecentAvatarUtils */;
|
|
createPendingImage = moduleValue2.createPendingImage;
|
|
object = {};
|
|
object.imageUri = (require(15780) /* metro dependency 15780: PresetAvatarSelect */).DEFAULT_AVATARS[property2];
|
|
object.description = (require(8403) /* metro dependency 8403: RecentAvatarUtils */).generateAvatarDescription();
|
|
r0 = Reflect.apply(createPendingImage, moduleValue2, [object]);
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
const r10 = r0 ?? pendingAvatar;
|
|
const videoBackgroundModule = require(8421) /* metro dependency 8421: VideoBackground */;
|
|
const value6 = videoBackgroundModule.memoizedImageSource(r10 == null ? value : r10.imageUri);
|
|
const items2 = [styles.contentContainer];
|
|
const object3 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.paddingBottom = bottom + PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.paddingHorizontal = PX_16;
|
|
items2[1] = object3;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const XQRWvR = (require(1244) /* metro dependency 1244: indexNative */).t.XQRWvR;
|
|
const items3 = [<View><Text style={styles.title} accessibilityRole="header" variant="heading-xl/extrabold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
intl,
|
|
[XQRWvR])}</Text><Text style={styles.subtitle} variant="text-sm/medium" color="text-default">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fH9TLT)}</Text></View>];
|
|
items3[1] = ((Component) => <Component avatarSource={value6} showPendingAvatar={r10 != null} onSelectAvatar={function() {
|
|
return RedesignAddAvatarModal_handleSelectAvatar.apply(this, arguments);
|
|
}} />)(importDefault(15789) /* metro dependency 15789: TouchableUploadAvatar */);
|
|
items3[2] = <View style={styles.errorContainer}>{property && <Text variant="text-sm/medium" color="text-feedback-critical">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.XyLlVm)}</Text>}</View>;
|
|
const items4 = [<View style={styles.headerContainer}>{items3}</View>];
|
|
items4[1] = ((Component) => <Component onAvatarSelect={property3} selectedAvatar={property2} />)(importDefault(15780) /* metro dependency 15780: PresetAvatarSelect */);
|
|
items4[2] = <View style={styles.growContainer} />;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
const PDTjLN = (require(1244) /* metro dependency 1244: indexNative */).t.PDTjLN;
|
|
items4[3] = <View style={styles.buttonContainer}><Button variant="primary" size="lg" text={Reflect.apply(string,
|
|
intl, [PDTjLN])} onPress={onPress_121360} disabled={r10 == null} /></View>;
|
|
return (
|
|
<ScrollView
|
|
style={styles.container}
|
|
alwaysBounceVertical={false}
|
|
contentContainerStyle={items2}
|
|
>
|
|
{items4}
|
|
</ScrollView>
|
|
);
|
|
}
|
|
|
|
function RedesignAddAvatarModal_handleSelectAvatar() { // fn#121355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16003:1228, owner: RedesignAddAvatarModal._handleSelectAvatar, offset: 0x02545a04, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return env1_3(_fun121357).apply(this, arguments);
|
|
}
|
|
|
|
function RedesignAddAvatarModalOnPress() { // fn#121360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16003:2755, owner: RedesignAddAvatarModal.onPress, offset: 0x02545b96, size: 76 bytes, params: 1, frame: 17
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = require(15777) /* metro dependency 15777: AddAvatarModalActionCreators */;
|
|
return value.handlePressNext(env0_4, env0_2, onComplete ?? (function() {
|
|
}));
|
|
}
|
|
|
|
function* _fun121357() { // fn#121357, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16003:1289, offset: 0x02545a44, size: 313 bytes, params: 1, frame: 22
|
|
var r4;
|
|
var match;
|
|
var binding2;
|
|
var value8;
|
|
var createPendingImage;
|
|
var binding3;
|
|
var value11;
|
|
var announcePendingAvatarChange;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const value3 = undefined;
|
|
importDefault(false);
|
|
let binding = env3_0;
|
|
const value5 = binding(env3_2[14]);
|
|
const openImagePicker = value5.openImagePicker;
|
|
let object2 = {size: env3_9};
|
|
yield Reflect.apply(openImagePicker, value5, [object2]);
|
|
const value6 = undefined;
|
|
if (false) {
|
|
return value6;
|
|
}
|
|
const base64 = value6.base64;
|
|
if (base64 == null) {
|
|
if (base64 != null) {
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
value8 = binding(binding2[11]);
|
|
createPendingImage = value8.createPendingImage;
|
|
object2 = {imageUri: base64};
|
|
object2.description = binding(binding2[11]).generateAvatarDescription();
|
|
r4 = Reflect.apply(createPendingImage, value8, [object2]);
|
|
} else {
|
|
r4 = value3;
|
|
}
|
|
binding = env3_0;
|
|
binding3 = env3_2;
|
|
binding(binding3[15]).setPendingChanges({avatar: r4});
|
|
value11 = binding(binding3[16]);
|
|
announcePendingAvatarChange = value11.announcePendingAvatarChange;
|
|
r4 = r4 == null ? 'remove' : 'set';
|
|
Reflect.apply(announcePendingAvatarChange, value11, [r4]);
|
|
env2_3(value3);
|
|
} else {
|
|
match = base64.match;
|
|
binding = env3_0;
|
|
if (Reflect.apply(match, base64, [binding(env3_2[14]).base64GIFRegex]) != null) {
|
|
importDefault(true);
|
|
} else {
|
|
if (base64 != null) {
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
value8 = binding(binding2[11]);
|
|
createPendingImage = value8.createPendingImage;
|
|
object2 = {imageUri: base64};
|
|
object2.description = binding(binding2[11]).generateAvatarDescription();
|
|
r4 = Reflect.apply(createPendingImage, value8, [object2]);
|
|
} else {
|
|
r4 = value3;
|
|
}
|
|
binding = env3_0;
|
|
binding3 = env3_2;
|
|
binding(binding3[15]).setPendingChanges({avatar: r4});
|
|
value11 = binding(binding3[16]);
|
|
announcePendingAvatarChange = value11.announcePendingAvatarChange;
|
|
r4 = r4 == null ? 'remove' : 'set';
|
|
Reflect.apply(announcePendingAvatarChange, value11, [r4]);
|
|
env2_3(value3);
|
|
}
|
|
}
|
|
return value3;
|
|
}
|
|
|