101 lines
6.1 KiB
TypeScript
101 lines
6.1 KiB
TypeScript
/* Metro module 9321; source: modules/lurker_mode/native/LurkerServerPreviewJoinButton.tsx; dependencies: [31, 1379, 1878, 3785, 661, 33, 566, 6927, 1314, 6914, 6929, 6593, 4578, 1244, 1423, 3995, 2] */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import AvatarUtils from '../../../utils/AvatarUtils.tsx'; /* Metro dependency 1423 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import LurkingStore from '../LurkingStore.tsx'; /* Metro dependency 3785 */
|
|
import UserUtils from '../../../utils/UserUtils.tsx'; /* Metro dependency 3995 */
|
|
import LurkerPreviewManager from '../LurkerPreviewManager.tsx'; /* Metro dependency 6929 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as LurkerPreviewAnalyticsModule from '../LurkerPreviewAnalytics.tsx'; /* Metro dependency 6914 */
|
|
|
|
function _fun72815(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:6, offset: 0x01d54ae7, size: 222 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
value = value.memo(LurkerServerPreviewJoinButton);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/lurker_mode/native/LurkerServerPreviewJoinButton.tsx');
|
|
exports.default = value;
|
|
function LurkerServerPreviewJoinButton({guildId, joinSource, onBeforeJoin}) { // fn#72816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:191, offset: 0x01d54bc5, size: 442 bytes, params: 2, frame: 20
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const Button = (ButtonNativeModule).Button;
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const value2 = currentUser.useCallback(_fun72818, [guildId, joinSource, onBeforeJoin]);
|
|
if (currentUser == null) {
|
|
return (
|
|
<Button
|
|
grow
|
|
variant="primary"
|
|
size="md"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.VJlc0S)}
|
|
onPress={value2}
|
|
/>
|
|
);
|
|
}
|
|
const userAvatarSource = (AvatarUtils).getUserAvatarSource(currentUser,
|
|
false);
|
|
const value4 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['5qtVhX'],
|
|
{usernameHook: usernameHook_72819});
|
|
const Button2 = (ButtonNativeModule).Button;
|
|
const Icon = Button2.Icon;
|
|
return (
|
|
<Button
|
|
grow
|
|
variant="primary"
|
|
size="md"
|
|
text={value4}
|
|
icon={<Icon source={userAvatarSource} variant="entity" />}
|
|
onPress={value2}
|
|
/>
|
|
);
|
|
function _fun72818() { // fn#72818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:351, offset: 0x01d54d7f, size: 279 bytes, params: 1, frame: 21
|
|
var channelStoreBinding;
|
|
var value5;
|
|
var moduleValue;
|
|
let value = environment.__proto__;
|
|
const lurkingSourceForGuild = LurkingStore.getLurkingSourceForGuild(guildId);
|
|
const value4 = undefined;
|
|
const type = lurkingSourceForGuild == null ? value4 : lurkingSourceForGuild.type;
|
|
const DIRECTORY_ENTRY = JoinGuildSources.DIRECTORY_ENTRY;
|
|
if (type === DIRECTORY_ENTRY) {
|
|
channelStoreBinding = ChannelStore;
|
|
value5 = channelStoreBinding.getChannel(lurkingSourceForGuild.directoryChannelId);
|
|
if (value5 != null) {
|
|
moduleValue = require(6927) /* metro dependency 6927: HubProgressActionCreators */;
|
|
moduleValue.setHubProgressActionComplete(value5.getGuildId(),
|
|
(require(1314) /* metro dependency 1314: preloaded_user_settings */).HubProgressStep.JOIN_GUILD);
|
|
}
|
|
}
|
|
const trackJoinClicked = LurkerPreviewAnalyticsModule.trackJoinClicked;
|
|
guildIdBinding = guildId;
|
|
const joinSourceBinding = joinSource;
|
|
const defaultImport = LurkerPreviewManager;
|
|
Reflect.apply(trackJoinClicked, LurkerPreviewAnalyticsModule, [guildIdBinding, joinSourceBinding,
|
|
defaultImport.hasNavigatedAway(guildIdBinding)]);
|
|
if (onBeforeJoin != null) {
|
|
onBeforeJoin();
|
|
}
|
|
value = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
|
|
value.joinGuild(guildId, {source: joinSource});
|
|
return value4;
|
|
}
|
|
|
|
function LurkerServerPreviewJoinButtonUsernameHook() { // fn#72819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:936, owner: LurkerServerPreviewJoinButton.usernameHook, offset: 0x01d54e96, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (UserUtils).getFormattedName(currentUser);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun72815, 9321, [31, 1379, 1878, 3785, 661, 33, 566, 6927, 1314, 6914, 6929, 6593, 4578, 1244, 1423,
|
|
3995,
|
|
2]) /* metro module 9321, dependencies: [31, 1379, 1878, 3785, 661, 33, 566, 6927, 1314, 6914, 6929, 6593, 4578, 1244, 1423, 3995, 2] */;
|