This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,109 @@
// Metro module 11764 (f11765).
import { useRef, useEffect } from "react";
import { View } from "react-native";
import GuildChannelStore from "../../../../../stores/GuildChannelStore";
import { HUB_PROGRESS_ACTION_SHEET_ID, HUB_PROGRESS_NUM_TOTAL_STEPS } from "../../../HubProgressBarConstants";
import { AnalyticEvents, AnalyticsLocations, InstantInviteSources, Routes } from "../../../../../Constants";
import { DirectoryChannelScrollBehavior } from "../../../../directory_channels/native/GuildDirectoryConstants";
import { AnalyticsActions, AnalyticsSetupTypes } from "../../../../guild_progress/GuildProgressConstants";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import { useHubProgressBarCompletedSteps } from "../../../HubProgressBarUtils";
import { MIN_PROGRESS_PERCENT } from "../../../../guild_progress/native/GuildProgressUtils";
import AnalyticsUtils from "../../../../../utils/AnalyticsUtils";
import { skipHubProgress } from "../../../HubProgressActionCreators";
import { intl, t } from "../../../../../intl/index.native";
import { GuildProgressHeader } from "../../../../guild_progress/native/action_sheet/GuildProgressActionSheet";
import { Text } from "../../../../../design/components/Text/native/Text";
import ProgressItem from "../../../../guild_progress/native/components/ProgressItem";
import { transitionTo } from "../../../../routing/router_utils";
import Module11765 from "../../../../../_bundle/Module11765";
import { HubProgressStep } from "../../../../../_bundle/Module1306";
import { handleOpenInviteActionsheet } from "../../../../instant_invite/native/InstantInviteUtils";
import Module11766 from "../../../../../_bundle/Module11766";
import { openContactSyncModal } from "../../../../contact_sync/native/ContactSyncModalActionCreators";
import Module11854 from "../../../../../_bundle/Module11854";
import { Button } from "../../../../../design/components/Button/native/Button.native";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { BottomSheet } from "../../../../../design/components/Sheet/native/BottomSheet.native";
const useStyles = createStyles({
container: {
padding: 16
},
footer: {
marginTop: 12,
display: "flex",
alignItems: "center"
}
});
export default function HubProgressActionSheet(props) {
const { guild, analyticsSource } = props;
const styles = useStyles();
const hubProgressBarCompletedSteps = useHubProgressBarCompletedSteps(guild);
const size = hubProgressBarCompletedSteps.size;
const r3 = Math.max(MIN_PROGRESS_PERCENT, 100 * size / HUB_PROGRESS_NUM_TOTAL_STEPS) === 100;
const ref = useRef(analyticsSource);
useEffect(() => {
ref.current = analyticsSource;
});
useEffect(() => {
AnalyticsUtils.track(AnalyticEvents.OPEN_MODAL, {
type: "Hub Progress Action Sheet",
guild_id: guild.id,
source: ref.current
});
}, [guild.id]);
const title = r3 ? intl.string(t.zQ4gGo) : intl.string(t.hRVjpT);
const handleFinishPress = function handleFinishPress() {
AnalyticsUtils.track(AnalyticEvents.SERVER_SETUP_CTA_CLICKED, {
setup_type: AnalyticsSetupTypes.HUB_PROGRESS,
action: AnalyticsActions.DISMISS,
num_total_actions: HUB_PROGRESS_NUM_TOTAL_STEPS,
num_actions_completed: size
});
skipHubProgress(guild.id);
ActionSheetActionCreators.hideActionSheet(HUB_PROGRESS_ACTION_SHEET_ID);
};
return <BottomSheet startExpanded>
<View style={styles.container}>
<GuildProgressHeader title={title} subtitle={intl.format(t.l6iRLs, {
numFinished: size,
total: HUB_PROGRESS_NUM_TOTAL_STEPS,
stepsHook: (a0, a1) => <Text key={a1} variant="text-sm/medium" color="mobile-text-heading-primary">
{a0}
</Text>
})} />
<ProgressItem onPress={function onPress() {
const defaultChannel = GuildChannelStore.getDefaultChannel(guild.id);
if (defaultChannel != null) {
transitionTo(Routes.CHANNEL(guild.id, defaultChannel.id), {
state: {
scrollBehavior: DirectoryChannelScrollBehavior.GUILD_LIST_TOP
}
});
ActionSheetActionCreators.hideActionSheet(HUB_PROGRESS_ACTION_SHEET_ID);
}
}} source={Module11765} title={intl.string(t.iNR25n)} isCompleted={hubProgressBarCompletedSteps.has(HubProgressStep.JOIN_GUILD)} analyticsSetupType={AnalyticsSetupTypes.HUB_PROGRESS} analyticsAction={AnalyticsActions.JOIN_GUILD} />
<ProgressItem onPress={function onPress() {
const defaultChannel = GuildChannelStore.getDefaultChannel(guild.id);
const channels = GuildChannelStore.getChannels(guild.id);
if (defaultChannel != null && channels != null) {
handleOpenInviteActionsheet(guild, defaultChannel.id, channels, InstantInviteSources.HUB_PROGRESS);
}
}} source={Module11766} title={intl.string(t["3NlTYU"])} isCompleted={hubProgressBarCompletedSteps.has(HubProgressStep.INVITE_USER)} analyticsSetupType={AnalyticsSetupTypes.HUB_PROGRESS} analyticsAction={AnalyticsActions.INVITE} />
<ProgressItem onPress={function onPress() {
if (!hubProgressBarCompletedSteps.has(HubProgressStep.CONTACT_SYNC)) {
openContactSyncModal({}, AnalyticsLocations.HUB_PROGRESS);
ActionSheetActionCreators.hideActionSheet(HUB_PROGRESS_ACTION_SHEET_ID);
}
}} source={Module11854} title={intl.string(t.HFvFte)} isCompleted={hubProgressBarCompletedSteps.has(HubProgressStep.CONTACT_SYNC)} analyticsSetupType={AnalyticsSetupTypes.HUB_PROGRESS} analyticsAction={AnalyticsActions.CONTACT_SYNC} />
<View style={[styles.footer]}>
{r3 ? <Button text={intl.string(t["0/5zhg"])} onPress={handleFinishPress} /> : <PressableOpacity accessibilityRole="button" onPress={handleFinishPress}>
<Text variant="text-sm/medium" color="text-default">
{intl.string(t["9E36wf"])}
</Text>
</PressableOpacity>}
</View>
</View>
</BottomSheet>;
};
@@ -0,0 +1,60 @@
// Metro module 11763 (f11764).
import { View } from "react-native";
import { HUB_PROGRESS_ACTION_SHEET_ID, HUB_PROGRESS_NUM_TOTAL_STEPS } from "../../../HubProgressBarConstants";
import { GUILD_DIRECTORY_PROGRESS_BAR_HEIGHT } from "../../../../directory_channels/native/GuildDirectoryConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useHubProgressBarCompletedSteps, getNextHubProgressStep, getHubProgressTitleForStep } from "../../../HubProgressBarUtils";
import { HubProgressStep } from "../../../../../_bundle/Module1306";
import { intl, t } from "../../../../../intl/index.native";
import { FormCTA } from "../../../../../design/void/Form/native/index";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import Module11855 from "../../../../../_bundle/Module11855";
const useStyles = createStyles({
container: {
overflow: "hidden",
height: GUILD_DIRECTORY_PROGRESS_BAR_HEIGHT,
padding: 16
},
icon: {
width: 48,
height: 48
},
innerContainer: {
paddingVertical: 8,
paddingLeft: 8,
paddingRight: 12,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH
}
});
export default function HubProgressHeader(props) {
const guild = props.guild;
let onDirectoryPage = props.onDirectoryPage;
if (onDirectoryPage === void 0) {
onDirectoryPage = false;
}
let c19138_1 = onDirectoryPage;
const styles = useStyles();
const hubProgressBarCompletedSteps = useHubProgressBarCompletedSteps(guild);
const nextHubProgressStep = getNextHubProgressStep(hubProgressBarCompletedSteps);
if (nextHubProgressStep == null) {
return null;
}
const size = hubProgressBarCompletedSteps.size;
if (onDirectoryPage) {
onDirectoryPage = nextHubProgressStep === HubProgressStep.JOIN_GUILD;
}
return <View style={styles.container}>
<FormCTA style={styles.innerContainer} iconStyle={styles.icon} onPress={function onPress() {
if (!(c19138_1 && nextHubProgressStep === HubProgressStep.JOIN_GUILD)) {
ActionSheetActionCreators.openLazy(import("./HubProgressActionSheet"), HUB_PROGRESS_ACTION_SHEET_ID, {
guild,
analyticsSource: "Directory Channel Header"
});
}
}} iconSource={Module11855} title={getHubProgressTitleForStep(nextHubProgressStep)} subtitle={size < HUB_PROGRESS_NUM_TOTAL_STEPS ? intl.formatToPlainString(t["9j7xDu"], {
number: `${size}`,
total: HUB_PROGRESS_NUM_TOTAL_STEPS
}) : intl.string(t["+Gyklt"])} trailing={onDirectoryPage ? <View /> : void 0} />
</View>;
};
@@ -0,0 +1,25 @@
// Metro module 15180 (f15181).
import { HUB_PROGRESS_ACTION_SHEET_ID, HUB_PROGRESS_NUM_TOTAL_STEPS } from "../../../HubProgressBarConstants";
import { useHubProgressBarCompletedSteps, getNextHubProgressStep, getHubProgressTitleForStep } from "../../../HubProgressBarUtils";
import { intl, t } from "../../../../../intl/index.native";
import { MIN_PROGRESS_PERCENT } from "../../../../guild_progress/native/GuildProgressUtils";
import { GuildProgressOverviewView } from "../../../../guild_progress/native/components/GuildProgressOverview";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
export default function HubSidebarProgressOverview(props) {
const guild = props.guild;
const hubProgressBarCompletedSteps = useHubProgressBarCompletedSteps(guild);
const nextHubProgressStep = getNextHubProgressStep(hubProgressBarCompletedSteps);
if (nextHubProgressStep == null) {
return null;
}
const size = hubProgressBarCompletedSteps.size;
return <GuildProgressOverviewView onPress={function onPress() {
ActionSheetActionCreators.openLazy(import("./HubProgressActionSheet"), HUB_PROGRESS_ACTION_SHEET_ID, {
guild,
analyticsSource: "Channels Sidebar"
});
}} title={getHubProgressTitleForStep(nextHubProgressStep)} subtitle={size < HUB_PROGRESS_NUM_TOTAL_STEPS ? intl.formatToPlainString(t["9j7xDu"], {
number: `${size}`,
total: HUB_PROGRESS_NUM_TOTAL_STEPS
}) : intl.string(t["+Gyklt"])} percentComplete={Math.max(MIN_PROGRESS_PERCENT, 100 * size / HUB_PROGRESS_NUM_TOTAL_STEPS)} />;
};