271 lines
15 KiB
TypeScript
271 lines
15 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] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
import ApplicationStore from '../../applications/ApplicationStore.tsx'; /* Metro dependency 4234 */
|
|
import Platforms from '../../../lib/Platforms.tsx'; /* Metro dependency 4915 */
|
|
import AuthorizeConnectionNative from '../../connections/authorizeConnection.native.tsx'; /* Metro dependency 9354 */
|
|
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 CheckmarkLargeIconModule from '../../../design/components/Icon/native/redesign/generated/CheckmarkLargeIcon.tsx'; /* Metro dependency 4064 */
|
|
import * as CircleInformationIconModule from '../../../design/components/Icon/native/redesign/generated/CircleInformationIcon.tsx'; /* Metro dependency 4068 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as MoreHorizontalIconModule from '../../../design/components/Icon/native/redesign/generated/MoreHorizontalIcon.tsx'; /* Metro dependency 8638 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {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 object2 = {'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;
|
|
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.borderColor = BORDER_SUBTLE;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object.card = object2;
|
|
object.cardName = {'flex': 1, 'minWidth': 0};
|
|
object.cardInfo = {'flex': 1, 'minWidth': 0, 'flexDirection': 'column', 'gap': 2};
|
|
const object3 = {'width': 40, 'height': 40};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.platformIcon = object3;
|
|
const object4 = {'width': 32, 'height': 32};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.platformIconSmall = object4;
|
|
const object5 = {'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;
|
|
object5.backgroundColor = BACKGROUND_FEEDBACK_INFO;
|
|
const ICON_FEEDBACK_INFO = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_INFO;
|
|
object5.borderColor = ICON_FEEDBACK_INFO;
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.infoNotice = object5;
|
|
object.infoText = {flex: 1};
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object.divider = {'height': 1, 'backgroundColor': null, 'marginVertical': 8, backgroundColor: BORDER_SUBTLE};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).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 = (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 = (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 ?? '';
|
|
ReactModule.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 = (MoreHorizontalIconModule).MoreHorizontalIcon;
|
|
const INTERACTIVE_TEXT_DEFAULT = (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 = (TextModule).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 = (ButtonNativeModule).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 = (CircleInformationIconModule).CircleInformationIcon;
|
|
const ICON_FEEDBACK_INFO = (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 _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__;
|
|
(AuthorizeConnectionNative)({platformType: platformType,
|
|
location: 'OAuth2 Connect Account Step'});
|
|
}
|
|
|
|
}
|
|
|
|
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 = (UseTheme)();
|
|
const value3 = (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 = (TextModule).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 = (CheckmarkLargeIconModule).CheckmarkLargeIcon;
|
|
const TEXT_FEEDBACK_POSITIVE = (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>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun73091, 9353, [31, 27, 4234, 1226, 1878, 33, 4501, 697, 4048, 566, 4915, 1423, 4002, 6772, 1305, 8638,
|
|
4573, 1244, 4578, 9354, 4068, 4064,
|
|
2]) /* metro module 9353, dependencies: [31, 27, 4234, 1226, 1878, 33, 4501, 697, 4048, 566, 4915, 1423, 4002, 6772, 1305, 8638, 4573, 1244, 4578, 9354, 4068, 4064, 2] */;
|