182 lines
12 KiB
TypeScript
182 lines
12 KiB
TypeScript
/* Metro module 9353; source: modules/oauth2/native/ConnectAccountStep.tsx; dependencies: [31, 27, 4234, 1226, 1878, 33, 4501, 697, 4048, 566, 4915, 1423, 4002, 6772, 1305, 8638, 4573, 1244, 4578, 9354, 4068, 4064, 2] */
|
|
function _fun73091(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9539:6, offset: 0x01d5e2f3, size: 689 bytes, params: 8, frame: 23
|
|
var object6;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object6 = {container: {'flexDirection': 'column', 'gap': 16, 'width': '100%'}, header: {'flexDirection': 'column',
|
|
'alignItems': 'center', 'gap': 8, 'marginBottom': 8}, headerIcons: {'flexDirection': 'row',
|
|
'alignItems': 'center', 'gap': 16, 'marginBottom': 8}};
|
|
const object7 = {'flexDirection': 'row', 'alignItems': 'center', 'gap': 12, 'padding': 16, 'backgroundColor': null,
|
|
'borderColor': null, 'borderWidth': 1};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object7.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object7.borderColor = BORDER_SUBTLE;
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object6.card = object7;
|
|
object6.cardName = {'flex': 1, 'minWidth': 0};
|
|
object6.cardInfo = {'flex': 1, 'minWidth': 0, 'flexDirection': 'column', 'gap': 2};
|
|
const object8 = {'width': 40, 'height': 40};
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object6.platformIcon = object8;
|
|
const object9 = {'width': 32, 'height': 32};
|
|
object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object6.platformIconSmall = object9;
|
|
const object10 = {'flexDirection': 'row', 'alignItems': 'flex-start', 'gap': 8, 'padding': 12,
|
|
'backgroundColor': null, 'borderColor': null, 'borderWidth': 1};
|
|
const BACKGROUND_FEEDBACK_INFO = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_FEEDBACK_INFO;
|
|
object10.backgroundColor = BACKGROUND_FEEDBACK_INFO;
|
|
const ICON_FEEDBACK_INFO = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_INFO;
|
|
object10.borderColor = ICON_FEEDBACK_INFO;
|
|
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object6.infoNotice = object10;
|
|
object6.infoText = {flex: 1};
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object6.divider = {'height': 1, 'backgroundColor': null, 'marginVertical': 8, backgroundColor: BORDER_SUBTLE};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object6]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/oauth2/native/ConnectAccountStep.tsx');
|
|
exports.default = ConnectAccountStep;
|
|
exports.ConnectedAccountCard = ConnectedAccountCard;
|
|
}
|
|
|
|
function ConnectAccountStep({clientId, platformType, platformName}) { // fn#73092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9539:1241, offset: 0x01d5e5a4, size: 1443 bytes, params: 2, frame: 35
|
|
var r12;
|
|
var moduleValue3;
|
|
var makeSource;
|
|
var isThemeLight2;
|
|
var icon;
|
|
const styles = useStyles();
|
|
const value3 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationStore], function() {
|
|
return ApplicationStore.getApplication(clientId);
|
|
}, [clientId]);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore, UserStore],
|
|
_fun73094);
|
|
const value6 = (importDefault(4915) /* metro dependency 4915: Platforms */).get(platformType);
|
|
if (value6 != null) {
|
|
moduleValue3 = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
makeSource = moduleValue3.makeSource;
|
|
isThemeLight2 = (require(4002) /* metro dependency 4002: shared */).isThemeLight(value3);
|
|
icon = value6.icon;
|
|
r12 = Reflect.apply(makeSource, moduleValue3, [isThemeLight2 ? icon.lightPNG : icon.darkPNG]);
|
|
} else {
|
|
r12 = null;
|
|
}
|
|
const r18 = value4 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getApplicationIconSource({id: value4.id,
|
|
icon: value4.icon}) : undefined;
|
|
const r21 = value5 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getUserAvatarSource(value5) : undefined;
|
|
const r16 = value4?.name ?? '';
|
|
env0_3.useEffect(_fun73095, [clientId]);
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
let XLARGE = AvatarSizes.XLARGE;
|
|
const items2 = [<Avatar source={r18} size={XLARGE} />];
|
|
const MoreHorizontalIcon = (require(8638) /* metro dependency 8638: MoreHorizontalIcon */).MoreHorizontalIcon;
|
|
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
items2[1] = <MoreHorizontalIcon color={INTERACTIVE_TEXT_DEFAULT} size="md" />;
|
|
XLARGE = AvatarSizes.XLARGE;
|
|
items2[2] = <Avatar source={r21} size={XLARGE} />;
|
|
const items3 = [<View style={styles.headerIcons}>{items2}</View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
items3[1] = <Text variant="text-lg/normal" color="text-default">{Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t.uT1CPa])}</Text>;
|
|
items3[2] = <Text variant="heading-xl/semibold" color="mobile-text-heading-primary">{r16}</Text>;
|
|
const items4 = [<View style={styles.header}>{items3}</View>];
|
|
items4[1] = <Text variant="text-sm/normal" color="text-default">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t['aJRE/Q'],
|
|
{applicationName: r16, platformName: platformName})}</Text>;
|
|
const items5 = [r12 != null ? ((Icon) => <Icon source={r12} style={styles.platformIcon} disableColor />)((require(1305) /* metro dependency 1305: native */).Icon) : null];
|
|
items5[1] = <Text variant="text-md/medium" style={styles.cardName} color="text-default">{platformName}</Text>;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const buttonProps = {'variant': 'primary', 'size': 'sm', onPress: onPress_73096};
|
|
string = intl.string;
|
|
const S0W8Z5 = (require(1244) /* metro dependency 1244: indexNative */).t.S0W8Z5;
|
|
buttonProps.text = Reflect.apply(string, intl, [S0W8Z5]);
|
|
items5[2] = <Button {...buttonProps} />;
|
|
items4[2] = <View style={styles.card}>{items5}</View>;
|
|
const CircleInformationIcon = (require(4068) /* metro dependency 4068: CircleInformationIcon */).CircleInformationIcon;
|
|
const ICON_FEEDBACK_INFO = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_INFO;
|
|
items4[3] = <View style={styles.infoNotice}><CircleInformationIcon color={ICON_FEEDBACK_INFO} size="sm" /><Text variant="text-sm/normal" color="text-default" style={styles.infoText}>{intl.format((require(1244) /* metro dependency 1244: indexNative */).t['8psEFX'],
|
|
{platformName: platformName, applicationName: r16})}</Text></View>;
|
|
return (
|
|
<View style={styles.container}>
|
|
{items4}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function ConnectedAccountCard({platformType, platformName, connectedAccount, applicationName}) { // fn#73097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9539:3198, offset: 0x01d5ebf0, size: 815 bytes, params: 2, frame: 36
|
|
var r12;
|
|
var moduleValue;
|
|
var makeSource;
|
|
var isThemeLight2;
|
|
var icon;
|
|
const styles = useStyles();
|
|
const value2 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const value3 = (importDefault(4915) /* metro dependency 4915: Platforms */).get(platformType);
|
|
if (value3 != null) {
|
|
moduleValue = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
makeSource = moduleValue.makeSource;
|
|
isThemeLight2 = (require(4002) /* metro dependency 4002: shared */).isThemeLight(value2);
|
|
icon = value3.icon;
|
|
r12 = Reflect.apply(makeSource, moduleValue, [isThemeLight2 ? icon.lightPNG : icon.darkPNG]);
|
|
} else {
|
|
r12 = null;
|
|
}
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let format = intl.format;
|
|
const items3 = [<Text variant="text-sm/normal" color="text-default">{Reflect.apply(format, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t['+oaRw3'], {platformName: platformName}])}</Text>];
|
|
const items2 = [r12 != null ? ((Icon) => <Icon source={r12} style={styles.platformIconSmall} disableColor />)((require(1305) /* metro dependency 1305: native */).Icon) : null];
|
|
const text = <Text variant="text-md/medium" color="mobile-text-heading-primary">{connectedAccount.name}</Text>;
|
|
format = intl.format;
|
|
const Dkd7sE = (require(1244) /* metro dependency 1244: indexNative */).t.Dkd7sE;
|
|
items2[1] = <View style={styles.cardInfo}>{text}<Text variant="text-xs/normal" color="text-muted">{Reflect.apply(format,
|
|
intl, [Dkd7sE, {platformName: platformName, connectedAccountId: connectedAccount.id}])}</Text></View>;
|
|
const CheckmarkLargeIcon = (require(4064) /* metro dependency 4064: CheckmarkLargeIcon */).CheckmarkLargeIcon;
|
|
const TEXT_FEEDBACK_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_POSITIVE;
|
|
items2[2] = <CheckmarkLargeIcon color={TEXT_FEEDBACK_POSITIVE} size="sm" />;
|
|
items3[1] = <View style={styles.card}>{items2}</View>;
|
|
items3[2] = <Text variant="text-sm/normal" color="text-default">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.pyRNXJ,
|
|
{applicationName: applicationName})}</Text>;
|
|
items3[3] = <View style={styles.divider} />;
|
|
return (
|
|
<View style={styles.container}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun73094() { // fn#73094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9539:1437, offset: 0x01d5eb62, size: 41 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
const id = AuthenticationStore.getId();
|
|
const value3 = null;
|
|
return value3 != id ? UserStore.getCurrentUser() : value3;
|
|
}
|
|
|
|
function _fun73095() { // fn#73095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9539:1775, offset: 0x01d5eb8b, size: 45 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__;
|
|
value = importDefault(6772) /* metro dependency 6772: ApplicationActionCreators */;
|
|
value.fetchApplication(clientId);
|
|
}
|
|
|
|
function ConnectAccountStepOnPress() { // fn#73096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9539:2751, owner: ConnectAccountStep.onPress, offset: 0x01d5ebb8, size: 56 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(importDefault(9354) /* metro dependency 9354: authorizeConnectionNative */)({platformType: platformType,
|
|
location: 'OAuth2 Connect Account Step'});
|
|
}
|
|
|