diff --git a/src/plugins/serverProfile/GuildProfileModal.tsx b/src/plugins/serverProfile/GuildProfileModal.tsx index d7bacef8..6d01c1d3 100644 --- a/src/plugins/serverProfile/GuildProfileModal.tsx +++ b/src/plugins/serverProfile/GuildProfileModal.tsx @@ -29,7 +29,7 @@ export function openGuildProfileModal(guild: Guild) { ); } -const enum TabsE { +const enum Tabs { ServerInfo, Friends, BlockedUsers @@ -48,6 +48,11 @@ const fetched = { blocked: false }; +const dateFormat = new Intl.DateTimeFormat(void 0, { timeStyle: "short", dateStyle: "medium" }); +function renderTimestampFromId(id: string) { + return dateFormat.format(SnowflakeUtils.extractTimestamp(id)); +} + function GuildProfileModal({ guild }: GuildProps) { const [friendCount, setFriendCount] = useState(); const [blockedCount, setBlockedCount] = useState(); @@ -57,7 +62,7 @@ function GuildProfileModal({ guild }: GuildProps) { fetched.blocked = false; }, []); - const [currentTab, setCurrentTab] = useState(TabsE.ServerInfo); + const [currentTab, setCurrentTab] = useState(Tabs.ServerInfo); const bannerUrl = guild.banner && IconUtils.getGuildBannerURL({ id: guild.id, @@ -73,7 +78,7 @@ function GuildProfileModal({ guild }: GuildProps) { return (
- {bannerUrl && currentTab === TabsE.ServerInfo && ( + {bannerUrl && currentTab === Tabs.ServerInfo && ( Server Info Friends{friendCount !== undefined ? ` (${friendCount})` : ""} Blocked Users{blockedCount !== undefined ? ` (${blockedCount})` : ""}
- {currentTab === TabsE.ServerInfo && } - {currentTab === TabsE.Friends && } - {currentTab === TabsE.BlockedUsers && } + {currentTab === Tabs.ServerInfo && } + {currentTab === Tabs.Friends && } + {currentTab === Tabs.BlockedUsers && }
); } -const dateFormat = new Intl.DateTimeFormat(void 0, { timeStyle: "short", dateStyle: "medium" }); -function renderTimestampFromId(id: string) { - return dateFormat.format(SnowflakeUtils.extractTimestamp(id)); -} - function Owner(guildId: string, owner: User) { const guildAvatar = GuildMemberStore.getMember(guildId, owner.id)?.avatar; const ownerAvatarUrl =