diff --git a/src/equicordplugins/messagePeek/index.tsx b/src/equicordplugins/messagePeek/index.tsx index f8d888c98..7e4ca60f3 100644 --- a/src/equicordplugins/messagePeek/index.tsx +++ b/src/equicordplugins/messagePeek/index.tsx @@ -16,7 +16,7 @@ import { classes } from "@utils/misc"; import definePlugin from "@utils/types"; import { Activity, ApplicationStream, Channel, Message, OnlineStatus, User } from "@vencord/discord-types"; import { MessageFlags } from "@vencord/discord-types/enums"; -import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findExportedComponentLazy } from "@webpack"; +import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findExportedComponentLazy, findLazy } from "@webpack"; import { ChannelStore, MessageStore, RelationshipStore, SnowflakeUtils, UserStore, useStateFromStores } from "@webpack/common"; const cl = classNameFactory("vc-message-peek-"); @@ -27,6 +27,7 @@ const MessageActions = findByPropsLazy("fetchMessages", "sendMessage"); const hasRelevantActivity: (props: ActivityCheckProps) => boolean = findByCodeLazy(".OFFLINE||", ".INVISIBLE)return!1"); const ActivityText: React.ComponentType = findComponentByCodeLazy("hasQuest:", "hideEmoji:"); +const FavoritesServerExperiment = findLazy(m => m?.definition?.id === "2021-09_favorites_server"); const ONE_HOUR_MS = 60 * 60 * 1000; @@ -163,7 +164,7 @@ function MessagePreviewContent({ channel, user }: { channel: Channel; user: User const currentUserId = UserStore.getCurrentUser()?.id; const isOwnMessage = lastMessage.author.id === currentUserId; - const authorName = isOwnMessage ? "You" : (smynName ?? RelationshipStore.getNickname(lastMessage.author.id) ?? lastMessage.author.globalName ?? lastMessage.author.username); + const authorName = isOwnMessage ? "You" : (smynName || RelationshipStore.getNickname(lastMessage.author.id) || lastMessage.author.globalName || lastMessage.author.username); const Icon = content.icon ? Icons[content.icon] : null; return ( @@ -211,15 +212,13 @@ function SubText({ channel, user, activities, applicationStream, voiceChannel, s } function Timestamp({ channel }: { channel: Channel; }) { - const lastMessage = useStateFromStores( - [MessageStore], - () => MessageStore.getLastMessage(channel.id) as Message | undefined - ); + const lastMessage = useStateFromStores([MessageStore], () => MessageStore.getLastMessage(channel.id) as Message | undefined); if (!lastMessage) return null; const timestamp = SnowflakeUtils.extractTimestamp(lastMessage.id); - return {formatRelativeTime(timestamp)}; + const className = FavoritesServerExperiment.getCurrentConfig().favoritesEnabled ? cl("timestamp-favorites") : cl("timestamp"); + return {formatRelativeTime(timestamp)}; } function shouldShowActivity(lastMessage: Message | undefined, hasActivity: boolean): boolean { diff --git a/src/equicordplugins/messagePeek/style.css b/src/equicordplugins/messagePeek/style.css index f10713e21..67f587a9d 100644 --- a/src/equicordplugins/messagePeek/style.css +++ b/src/equicordplugins/messagePeek/style.css @@ -8,6 +8,13 @@ color: var(--text-normal); } +.vc-message-peek-timestamp-favorites { + font-size: 12px; + font-weight: 500; + line-height: 16px; + color: var(--text-normal); +} + [class*="interactiveSelected__"] .vc-message-peek-timestamp { color: var(--white); } diff --git a/src/plugins/platformIndicators/index.tsx b/src/plugins/platformIndicators/index.tsx index 9c3fc55f4..25c4e5957 100644 --- a/src/plugins/platformIndicators/index.tsx +++ b/src/plugins/platformIndicators/index.tsx @@ -18,7 +18,7 @@ import "./style.css"; -import { definePluginSettings, migratePluginSetting, Settings } from "@api/Settings"; +import { definePluginSettings, migratePluginSetting } from "@api/Settings"; import { Devs } from "@utils/constants"; import { classes } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; @@ -131,7 +131,7 @@ interface PlatformIndicatorProps { } const PlatformIndicator = ({ user, isProfile, isMessage, isMemberList }: PlatformIndicatorProps) => { - if (user == null || (user.bot && !Settings.plugins.PlatformIndicators.showBots)) return null; + if (user == null || (user.bot && !settings.store.showBots)) return null; useEnsureOwnStatus(user); const status = useStateFromStores([PresenceStore], () => PresenceStore.getClientStatus(user.id)); diff --git a/src/plugins/replyTimestamp/style.css b/src/plugins/replyTimestamp/style.css index 7ac4a4966..c7cf22495 100644 --- a/src/plugins/replyTimestamp/style.css +++ b/src/plugins/replyTimestamp/style.css @@ -1,5 +1,4 @@ .vc-reply-timestamp { - display: inline-flex !important; - flex-shrink: 0; + width: fit-content !important; margin-right: 0.25em; }