91 lines
6.2 KiB
TypeScript
91 lines
6.2 KiB
TypeScript
/* Metro module 6770; source: modules/guild_onboarding/native/ApplicationConnectionCard.tsx; dependencies: [31, 4234, 661, 33, 566, 6771, 6772, 1244, 6774, 6780, 683, 4863, 6785, 2] */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import ApplicationStore from '../../applications/ApplicationStore.tsx'; /* Metro dependency 4234 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import UseStartAuthorize from '../../application_account_linking/native/useStartAuthorize.tsx'; /* Metro dependency 6774 */
|
|
import GameIcon from '../../game_detection/native/GameIcon.tsx'; /* Metro dependency 6780 */
|
|
import ConnectionCardView from './ConnectionCardView.tsx'; /* Metro dependency 6785 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as GameIconModule from '../../game_detection/native/GameIcon.tsx'; /* Metro dependency 6780 */
|
|
|
|
function _fun53320(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6948:6, offset: 0x01345ca6, size: 178 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/native/ApplicationConnectionCard.tsx');
|
|
exports.default = ApplicationConnectionCard;
|
|
function ApplicationConnectionCard({connection, guildId, location}) { // fn#53321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6948:261, offset: 0x01345d58, size: 478 bytes, params: 2, frame: 29
|
|
var r10;
|
|
var intl;
|
|
const value3 = (FluxModule).useStateFromStores([ApplicationStore], _fun53322,
|
|
[connection.application_id]);
|
|
const env0_3 = value3;
|
|
const analyticsLocations = (UseAnalyticsLocations)(location).analyticsLocations;
|
|
let binding = env0_3;
|
|
binding.useEffect(_fun53323, [value3, connection.application_id]);
|
|
const name = value3?.name;
|
|
if (name != null) {
|
|
r10 = name;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r10 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cgPbaZ);
|
|
}
|
|
const {hasAlreadyLinked, canStartAuthorization, startAuthorization,
|
|
fetched} = (UseStartAuthorize)(value3);
|
|
const GameIconSizes = (GameIconModule).GameIconSizes;
|
|
const SMALL = GameIconSizes.SMALL;
|
|
const gameIcon = <GameIcon game={value3} size={SMALL} />;
|
|
binding = env0_3;
|
|
const useCallback = binding.useCallback;
|
|
return ((Component) => <Component displayName={r10} description={connection.description} icon={gameIcon} isLoading={!fetched} isConnected={hasAlreadyLinked} canConnect={canStartAuthorization} onConnect={Reflect.apply(useCallback,
|
|
binding, [_fun53325, [startAuthorization, guildId, connection.application_id, location,
|
|
analyticsLocations]])} />)(ConnectionCardView);
|
|
function _fun53322() { // fn#53322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6948:373, offset: 0x01345f36, size: 52 bytes, params: 1, frame: 12
|
|
const application_id = connection.application_id;
|
|
const value2 = null;
|
|
return value2 != application_id ? ApplicationStore.getApplication(connection.application_id) : value2;
|
|
}
|
|
|
|
function _fun53323() { // fn#53323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6948:506, offset: 0x01345f6a, size: 163 bytes, params: 1, frame: 13
|
|
var environment;
|
|
var value7;
|
|
var moduleValue;
|
|
let r1 = env0_3 != null || connection.application_id == null;
|
|
r1 = !r1 ? ApplicationStore.isFetchingApplication(connection.application_id) : r1;
|
|
r1 = !r1 ? ApplicationStore.didFetchingApplicationFail(connection.application_id) : r1;
|
|
if (!r1) {
|
|
value7 = environment.__proto__;
|
|
moduleValue = require(6772) /* metro dependency 6772: ApplicationActionCreators */;
|
|
moduleValue.fetchApplication(connection.application_id).catch(function() {
|
|
});
|
|
}
|
|
}
|
|
|
|
function _fun53325() { // fn#53325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6948:963, offset: 0x0134600d, size: 170 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const GUILD_ONBOARDING_CONNECTION_CLICKED = AnalyticEvents.GUILD_ONBOARDING_CONNECTION_CLICKED;
|
|
const object = {};
|
|
value = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
copyDataProperties(object, value.collectGuildAnalyticsMetadata(guildId), value);
|
|
object['connection_type'] = 'application';
|
|
object['application_id'] = connection.application_id ?? value2;
|
|
object['location'] = location;
|
|
Reflect.apply(track, defaultImport, [GUILD_ONBOARDING_CONNECTION_CLICKED, object]);
|
|
startAuthorization({analyticsLocations: analyticsLocations});
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun53320, 6770, [31, 4234, 661, 33, 566, 6771, 6772, 1244, 6774, 6780, 683, 4863, 6785,
|
|
2]) /* metro module 6770, dependencies: [31, 4234, 661, 33, 566, 6771, 6772, 1244, 6774, 6780, 683, 4863, 6785, 2] */;
|