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,100 @@
// Metro module 14955 (f14956).
import { memo, useCallback, useEffect, useState } from "react";
import { View } from "react-native";
import ReanimatedRexport, { Easing, useSharedValue, useAnimatedProps } from "../../reanimated/ReanimatedRexport";
import Module8531, { Circle } from "../../../_bundle/Module8531";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { BADGE_PADDING } from "../../../design/void/native";
import * as _LurkerPreviewManager from "../LurkerPreviewManager";
import { useToken } from "../../../design/tokens/native/useToken";
import { withTiming } from "../../../design/animation/reanimated/timing/timing";
const PROGRESS_CIRCUMFERENCE = 2 * Math.PI * 6;
let c10581_8 = {
duration: 1000,
easing: Easing.linear
};
const AnimatedComponent = ReanimatedRexport.createAnimatedComponent(Circle);
const useStyles = createStyles({
outerRing: {
borderRadius: 20,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
position: "absolute",
bottom: -BADGE_PADDING,
right: -BADGE_PADDING,
padding: BADGE_PADDING,
height: 22,
width: 22,
alignItems: "center",
justifyContent: "center"
},
innerFill: {
borderRadius: 20,
backgroundColor: Module712.colors.BACKGROUND_MOD_STRONG,
height: 16,
width: 16,
alignItems: "center",
justifyContent: "center"
},
progressRing: {
position: "absolute",
transform: [{
rotate: "90deg"
}, {
scaleX: -1
}]
}
});
const __initData = {
code: "function LurkerPreviewCooldownBadgeTsx1(){const{PROGRESS_CIRCUMFERENCE,animatedProgress}=this.__closure;return{strokeDashoffset:PROGRESS_CIRCUMFERENCE*(1-animatedProgress.get())};}"
};
const r74 = memo(function LurkerPreviewCooldownBadge(props) {
let sharedValue;
const { expiresAt, totalDurationMs = _LurkerPreviewManager.LURKER_PREVIEW_PERSIST_MS } = props;
const LURKER_PREVIEW_PERSIST_MS = totalDurationMs;
const style = props.style;
sharedValue = void 0;
const styles = useStyles();
const token = useToken(Module712.colors.BACKGROUND_BRAND);
const callback = useCallback(() => {
const r9 = (expiresAt - Date.now()) / LURKER_PREVIEW_PERSIST_MS;
return 0.9 * (r9 < 0 ? 0 : r9 > 1 ? 1 : r9);
}, [expiresAt, LURKER_PREVIEW_PERSIST_MS]);
sharedValue = useSharedValue(callback());
useEffect(() => {
sharedValue.set(withTiming(callback(), c10581_8, "animate-always"));
let c27874_0 = setInterval(() => {
sharedValue.set(withTiming(callback(), c10581_8, "animate-always"));
}, 1000);
return () => {
clearInterval(c27874_0);
};
}, [sharedValue, callback]);
const r43 = () => ({
strokeDashoffset: PROGRESS_CIRCUMFERENCE * (1 - sharedValue.get())
});
r43.__closure = {
PROGRESS_CIRCUMFERENCE,
animatedProgress: sharedValue
};
r43.__workletHash = 7162520447613;
r43.__initData = __initData;
return <View style={[styles.outerRing, style]} pointerEvents="none" accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
<View style={styles.innerFill}>
<Module8531 width={16} height={16} style={styles.progressRing}>
<AnimatedComponent cx={8} cy={8} r={6} fill="none" stroke={token} strokeWidth={4} strokeDasharray={PROGRESS_CIRCUMFERENCE} strokeLinecap="butt" animatedProps={useAnimatedProps(r43)} />
</Module8531>
</View>
</View>;
});
export default r74;
export function useHasExpired(a0) {
const [state, setState] = useState(null);
useEffect(() => {
if (a0 != null) {
let c27875_0 = setTimeout(() => setState(a0), Math.max(0, a0 - Date.now()));
return () => clearTimeout(c27875_0);
}
}, [a0]);
return a0 != null && state === a0;
}
@@ -0,0 +1,44 @@
// Metro module 11527 (f11528).
import { memo, useCallback } from "react";
import ChannelStore from "../../../stores/ChannelStore";
import UserStore from "../../../stores/UserStore";
import LurkingStore from "../LurkingStore";
import { JoinGuildSources } from "../../../Constants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { setHubProgressActionComplete } from "../../hub/HubProgressActionCreators";
import { HubProgressStep } from "../../../_bundle/Module1306";
import { trackJoinClicked } from "../LurkerPreviewAnalytics";
import LurkerPreviewManager from "../LurkerPreviewManager";
import GuildActionCreators from "../../../actions/GuildActionCreators";
import { Button } from "../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../intl/index.native";
import AvatarUtils from "../../../utils/AvatarUtils";
import UserUtils from "../../../utils/UserUtils";
const r29 = memo(function LurkerServerPreviewJoinButton(props) {
const { guildId, joinSource, onBeforeJoin } = props;
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const callback = useCallback(() => {
const lurkingSourceForGuild = LurkingStore.getLurkingSourceForGuild(guildId);
if (lurkingSourceForGuild?.type === JoinGuildSources.DIRECTORY_ENTRY) {
const channel = ChannelStore.getChannel(lurkingSourceForGuild.directoryChannelId);
if (channel != null) {
setHubProgressActionComplete(channel.getGuildId(), HubProgressStep.JOIN_GUILD);
}
}
trackJoinClicked(guildId, joinSource, LurkerPreviewManager.hasNavigatedAway(guildId));
if (onBeforeJoin != null) {
onBeforeJoin();
}
GuildActionCreators.joinGuild(guildId, {
source: joinSource
});
}, [guildId, joinSource, onBeforeJoin]);
if (stateFromStores == null) {
return <Button grow variant="primary" size="md" text={intl.string(t.VJlc0S)} onPress={callback} />;
}
const userAvatarSource = AvatarUtils.getUserAvatarSource(stateFromStores, false);
return <Button grow variant="primary" size="md" text={intl.formatToPlainString(t["5qtVhX"], {
usernameHook: () => UserUtils.getFormattedName(stateFromStores)
})} icon={<Button.Icon source={userAvatarSource} variant="entity" />} onPress={callback} />;
});
export default r29;
@@ -0,0 +1,30 @@
// Metro module 8459 (f8460).
import { 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 { intl, t } from "../../../intl/index.native";
const useStyles = createStyles({
pill: {
position: "absolute",
top: 16,
left: 16,
paddingHorizontal: 10,
paddingVertical: 4,
borderRadius: Module712.radii.lg,
backgroundColor: Module712.colors.WHITE
},
text: {
color: Module712.colors.BLACK,
textTransform: "uppercase",
letterSpacing: 0.5
}
});
export default function ServerPreviewPill() {
const styles = useStyles();
return <View style={styles.pill} accessibilityRole="text">
<Text variant="text-xs/bold" style={styles.text}>
{intl.string(t.KNhFgD)}
</Text>
</View>;
};