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,83 @@
// Metro module 12824 (f12825).
import GuildMemberStore from "../../../stores/GuildMemberStore";
import GuildStore from "../../../stores/GuildStore";
import SelectedGuildStore from "../../../stores/SelectedGuildStore";
import UserStore from "../../../stores/UserStore";
import { GuildFeatures } from "../../../Constants";
import { GuildMemberFlags } from "../../guild_member/GuildMemberConstants";
import { Storage } from "../../../_bundle/Module595";
import { isNewUser } from "../../../utils/UserUtils";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { getRootNavigationRef } from "../../main_tabs_v2/RootNavigationRef.native";
import { getCurrentNavigationRouteName } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { hasFlag } from "../../../_bundle/Module1384";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
let c8847_9 = "2020_02_nuf_channels";
let c8847_10 = "2020_02_nuf_voice_channels";
class NUFChannelsManager extends AutomaticLifecycleManager {
actions = {
LOGOUT: () => this.clear()
};
handleNavigationStateChanged = () => {
if (getCurrentNavigationRouteName() === "guilds") {
const guildId = SelectedGuildStore.getGuildId();
const guild = GuildStore.getGuild(guildId);
let r1 = guildId != null && !(guild == null ? void 0 : guild.features.has(GuildFeatures.HUB));
const r26 = guild != null ? GuildMemberStore.getSelfMember(guild.id) : null;
let r30 = guild != null && guild.features.has(GuildFeatures.GUILD_ONBOARDING);
if (r30) {
let r38 = r26?.flags;
if (r38 == null) {
r38 = 0;
}
r30 = hasFlag(r38, GuildMemberFlags.STARTED_ONBOARDING);
}
if (r30) {
let r45 = r26?.flags;
if (r45 == null) {
r45 = 0;
}
r30 = !hasFlag(r45, GuildMemberFlags.COMPLETED_ONBOARDING);
}
if (r1) {
r1 = !r30;
}
if (r1) {
const r54 = Storage.get(c8847_9);
if (r54 ? !r54 : isNewUser(UserStore.getCurrentUser())) {
ActionSheetActionCreators.openLazy(import("./components/NUFChannelsActionSheet"), "NUFChannelsActionSheet");
Storage.set(c8847_9, true);
}
this.terminate();
}
}
};
requiresVoiceChannelsOnboard = () => {
const r9 = Storage.get(c8847_10);
return r9 ? !r9 : isNewUser(UserStore.getCurrentUser());
};
handleVoiceChannelsOnboard = () => {
Storage.set(c8847_10, true);
};
clear = () => {
Storage.remove(c8847_9);
Storage.remove(c8847_10);
};
_initialize() {
const r11 = Storage.get(c8847_9);
if (r11 ? !r11 : isNewUser(UserStore.getCurrentUser())) {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.addListener("state", this.handleNavigationStateChanged);
}
}
}
_terminate() {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.removeListener("state", this.handleNavigationStateChanged);
}
}
}
const nUFChannelsManager = new NUFChannelsManager();
export default nUFChannelsManager;
@@ -0,0 +1,193 @@
// Metro module 12827 (f12828).
import { useState, useEffect } from "react";
import { Image as Image2, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { intl, t } from "../../../../intl/index.native";
import Module12828 from "../../../../_bundle/Module12828";
import Module12829 from "../../../../_bundle/Module12829";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { withTiming } from "../../../../design/animation/reanimated/timing/timing";
import Module12830 from "../../../../_bundle/Module12830";
import Module12831 from "../../../../_bundle/Module12831";
import Module12832 from "../../../../_bundle/Module12832";
import Module12833 from "../../../../_bundle/Module12833";
import { Card } from "../../../../design/components/Card/native/Card.native";
import { TextIcon } from "../../../../design/components/Icon/native/redesign/generated/TextIcon";
import { Text } from "../../../../design/components/Text/native/Text";
import { HermesBuiltin } from "../../../../_hermes/prelude";
const useStyles = createStyles({
container: {
width: "100%",
maxWidth: 275,
position: "relative",
display: "flex",
justifyContent: "center",
alignItems: "center",
marginTop: 24,
marginBottom: 24
},
card: {
padding: 0,
width: "100%"
},
cardBackground: {
width: "90%",
height: 12,
borderTopLeftRadius: Module712.radii.lg,
borderTopRightRadius: Module712.radii.lg,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
header: {
paddingVertical: 12,
paddingHorizontal: 16,
display: "flex",
alignItems: "center",
flexDirection: "row",
borderBottomColor: Module712.colors.BORDER_SUBTLE,
borderBottomWidth: 1
},
content: {
height: 150,
paddingVertical: 8,
paddingHorizontal: 16,
display: "flex",
justifyContent: "flex-end",
overflow: "hidden"
},
message: {
display: "flex",
paddingVertical: 8,
flexDirection: "row"
},
messageAvatar: {
width: 40,
height: 40,
marginRight: 12
},
messageContent: {
display: "flex",
flex: 1
},
starMedium: {
height: 25,
width: 15
},
starSmall: {
height: 15,
width: 10
},
starGreen: {
position: "absolute",
top: 5,
left: -28
},
starBlue: {
position: "absolute",
top: -15,
left: -10
},
starPink: {
position: "absolute",
bottom: -18,
right: -22
},
starPurple: {
position: "absolute",
bottom: -30,
right: -2
}
});
const __initData = {
code: "function NUFChannelIllustrationTsx1(){const{interpolate,messageListAnimation}=this.__closure;return{transform:[{translateY:interpolate(messageListAnimation.get(),[0,1],[50,0])}]};}"
};
export default function NUFChannelIllustration() {
const styles = useStyles();
const [state, setState] = useState([]);
const sharedValue = useSharedValue(0);
const sharedValue2 = useSharedValue(0);
useEffect(() => {
let c27373_1;
let c27373_0 = setTimeout(() => setState((prevState) => {
const r2 = [,];
const r0 = HermesBuiltin.arraySpread(r2, prevState, 0);
const message = intl.string(t["5alrl0"]);
r2[r0] = {
name: intl.string(t["9m/HsX"]),
avatar: Module12828,
message
};
return r2;
}), 500);
c27373_1 = setTimeout(() => setState((prevState) => {
const r2 = [,];
const r0 = HermesBuiltin.arraySpread(r2, prevState, 0);
const message = intl.string(t["5Oo+vS"]);
r2[r0] = {
name: intl.string(t["AW1kM+"]),
avatar: Module12829,
message
};
return r2;
}), 2000);
return () => {
clearTimeout(c27373_0);
clearTimeout(c27373_1);
};
}, []);
useEffect(() => {
if (state.length >= 2) {
sharedValue2.set(withTiming(1, {
duration: 250
}));
}
}, [sharedValue2, state]);
useEffect(() => {
sharedValue.set(0);
sharedValue.set(withTiming(1, {
duration: 200
}));
}, [sharedValue, state]);
const b = function b() {
return {
transform: [{
translateY: _ReanimatedRexport.interpolate(sharedValue.get(), [0, 1], [50, 0])
}]
};
};
b.__closure = {
interpolate: _ReanimatedRexport.interpolate,
messageListAnimation: sharedValue
};
b.__workletHash = 1240710065054;
b.__initData = __initData;
const animatedStyle = useAnimatedStyle(b);
return <View style={styles.container}>
<Image2 source={Module12830} style={[styles.starSmall, styles.starBlue]} />
<Image2 source={Module12831} style={[styles.starMedium, styles.starPink]} />
<Image2 source={Module12832} style={[styles.starMedium, styles.starGreen]} />
<Image2 source={Module12833} style={[styles.starSmall, styles.starPurple]} />
<View style={styles.cardBackground} />
<Card style={styles.card} shadow="low" border="subtle">
<View style={styles.header}>
<TextIcon size="sm" />
<Text variant="text-md/bold" allowFontScaling={false}>
{" "}
{intl.string(t.aLOLry)}
</Text>
</View>
<View style={styles.content}>
<ReanimatedRexport.View style={animatedStyle}>
{state.map((item) => <View key={item.message} style={styles.message}>
<Image2 source={item.avatar} style={styles.messageAvatar} />
<View style={styles.messageContent}>
<Text variant="text-md/semibold" allowFontScaling={false}>{item.name}</Text>
<Text variant="text-md/medium" allowFontScaling={false}>{item.message}</Text>
</View>
</View>)}
</ReanimatedRexport.View>
</View>
</Card>
</View>;
};
@@ -0,0 +1,20 @@
// Metro module 12825 (f12826).
import { useCallback } from "react";
import { ContentDismissActionType } from "../../../dismissible_content/DismissibleContentConstants";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import NUFTemplateV2 from "./NUFTemplateV2";
import NUFChannelIllustration from "./NUFChannelIllustration";
import { intl, t } from "../../../../intl/index.native";
export default function NUFChannelsActionSheet(props) {
const markAsDismissed = props.markAsDismissed;
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
if (markAsDismissed != null) {
markAsDismissed(ContentDismissActionType.UNKNOWN);
}
}, [markAsDismissed]);
return <BottomSheet onDismiss={() => markAsDismissed == null ? void 0 : markAsDismissed(ContentDismissActionType.UNKNOWN)} startExpanded>
<NUFTemplateV2 illustration={<NUFChannelIllustration />} title={intl.string(t.Ay9424)} description={intl.string(t.mufH2P)} CTALabel={intl.string(t.BddRzS)} onCTAPress={callback} />
</BottomSheet>;
};
@@ -0,0 +1,35 @@
// Metro module 12835 (f12836).
import { Image as Image2, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
padding: 16,
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
title: {
textAlign: "center",
marginBottom: 8
},
description: {
textAlign: "center",
lineHeight: 18,
marginBottom: 24
},
image: {
marginBottom: 24
}
});
export default function NUFActionSheetTemplate(props) {
const { title, description, imageSrc, onCTAPress, CTALabel } = props;
const styles = useStyles();
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="heading-xl/extrabold" color="mobile-text-heading-primary">{title}</Text>
<Text style={styles.description} variant="text-sm/medium" color="text-default">{description}</Text>
<Image2 source={imageSrc} style={styles.image} />
<Button text={CTALabel} size="md" onPress={onCTAPress} grow />
</View>;
};
@@ -0,0 +1,36 @@
// Metro module 12826 (f12827).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
padding: 16,
alignItems: "center"
},
title: {
textAlign: "center",
marginBottom: 8
},
description: {
textAlign: "center",
marginBottom: 46,
paddingLeft: 18,
paddingRight: 18
},
illustration: {
alignSelf: "stretch",
alignItems: "center",
marginBottom: 32
}
});
export default function NUFActionSheetTemplate(props) {
const { title, illustration, description, onCTAPress, CTALabel } = props;
const styles = useStyles();
return <View style={styles.container}>
<View style={styles.illustration}>{illustration}</View>
<Text style={styles.title} accessibilityRole="header" variant="heading-xl/bold">{title}</Text>
<Text style={styles.description} variant="text-md/medium">{description}</Text>
<Button text={CTALabel} onPress={onCTAPress} grow />
</View>;
};
@@ -0,0 +1,15 @@
// Metro module 12834 (f12835).
import NUFTemplate from "./NUFTemplate";
import { intl, t } from "../../../../intl/index.native";
import Module12836 from "../../../../_bundle/Module12836";
import NUFChannelsManager from "../NUFChannelsManager";
import { dismissGlobalKeyboard } from "../../../../utils/native/KeyboardManagerUtils";
import SelectedChannelActionCreators from "../../../../actions/SelectedChannelActionCreators";
export default function NUFVoiceChannelsTemplate(props) {
const channel = props.channel;
return <NUFTemplate title={intl.string(t.w5HAll)} description={intl.string(t.Ww4hhq)} imageSrc={Module12836} CTALabel={intl.string(t.eIi3Om)} onCTAPress={() => {
NUFChannelsManager.handleVoiceChannelsOnboard();
dismissGlobalKeyboard();
SelectedChannelActionCreators.selectVoiceChannel(channel.id);
}} />;
};
@@ -0,0 +1,38 @@
// Metro module 15217 (f15218).
import GuildMemberStore from "../../../stores/GuildMemberStore";
import GuildStore from "../../../stores/GuildStore";
import UserStore from "../../../stores/UserStore";
import { GuildFeatures } from "../../../Constants";
import { GuildMemberFlags } from "../../guild_member/GuildMemberConstants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { isNewUser } from "../../../utils/UserUtils";
import { hasFlag } from "../../../_bundle/Module1384";
export function useCanSeeNUFChannelsForGuild(a0) {
return useStateFromStores([UserStore, GuildStore, GuildMemberStore], () => {
const currentUser = UserStore.getCurrentUser();
if (currentUser != null && isNewUser(currentUser)) {
const guild = GuildStore.getGuild(a0);
if (guild != null && !guild.features.has(GuildFeatures.HUB)) {
const selfMember = GuildMemberStore.getSelfMember(a0);
let r30 = guild.features.has(GuildFeatures.GUILD_ONBOARDING) && selfMember != null;
if (r30) {
let flags = selfMember.flags;
if (flags == null) {
flags = 0;
}
r30 = hasFlag(flags, GuildMemberFlags.STARTED_ONBOARDING);
}
if (r30) {
let flags2 = selfMember.flags;
if (flags2 == null) {
flags2 = 0;
}
r30 = !hasFlag(flags2, GuildMemberFlags.COMPLETED_ONBOARDING);
}
return !r30;
}
return false;
}
return false;
}, [a0]);
}