rename plugin
This commit is contained in:
parent
a2bd885094
commit
a40850a6bd
1 changed files with 26 additions and 22 deletions
48
index.tsx
48
index.tsx
|
@ -8,13 +8,13 @@ import "./style.css";
|
|||
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import { ChannelStore, DateUtils, GuildStore, IconUtils, NavigationRouter, Popout, SnowflakeUtils, Text, UserStore, useStateFromStores } from "@webpack/common";
|
||||
import { ChannelStore, DateUtils, GuildStore, IconUtils, NavigationRouter, Popout, SelectedGuildStore, SnowflakeUtils, Text, UserStore, useStateFromStores } from "@webpack/common";
|
||||
|
||||
import { ArrowSvg, checkForIconExistence, cl, ServerProfileComponent } from "./utils";
|
||||
|
||||
export default definePlugin({
|
||||
name: "MoreForwardMeta",
|
||||
description: "Show server profile under forwarded messages (if available) and always show time",
|
||||
name: "BetterForwardMeta",
|
||||
description: "Access server profile under forwarded messages (if available) and always show time",
|
||||
authors: [Devs.nin0dev],
|
||||
ForwardFooter(message: any) {
|
||||
const { guild_id, channel_id, message_id } = message.message.messageReference;
|
||||
|
@ -23,26 +23,30 @@ export default definePlugin({
|
|||
|
||||
return <div className={cl("footer")} >
|
||||
{
|
||||
guild_id && <Popout
|
||||
position="top"
|
||||
renderPopout={() => <ServerProfileComponent guildId={guild_id} />}
|
||||
>
|
||||
{popoutProps => <div className={cl("footer-element")} {...popoutProps}>
|
||||
{
|
||||
checkForIconExistence(guild) && <img src={guild.icon && IconUtils.getGuildIconURL({
|
||||
id: guild.id,
|
||||
icon: guild.icon,
|
||||
canAnimate: true,
|
||||
size: 32
|
||||
})} alt={`Server icon for ${guild.name}`} className={cl("guild-icon")} />
|
||||
}
|
||||
<Text variant="text-sm/medium" className={cl("footer-text")} style={{
|
||||
marginLeft: checkForIconExistence(guild) ? "20px" : "0"
|
||||
}}>{guild ? guild.name : "View server"} </Text>
|
||||
<ArrowSvg />
|
||||
</div>
|
||||
guild_id && <>
|
||||
{
|
||||
guild_id !== SelectedGuildStore.getGuildId() && <Popout
|
||||
position="top"
|
||||
renderPopout={() => <ServerProfileComponent guildId={guild_id} />}
|
||||
>
|
||||
{popoutProps => <div className={cl("footer-element")} {...popoutProps}>
|
||||
{
|
||||
checkForIconExistence(guild) && <img src={guild.icon && IconUtils.getGuildIconURL({
|
||||
id: guild.id,
|
||||
icon: guild.icon,
|
||||
canAnimate: true,
|
||||
size: 32
|
||||
})} alt={`Server icon for ${guild.name}`} className={cl("guild-icon")} />
|
||||
}
|
||||
<Text variant="text-sm/medium" className={cl("footer-text")} style={{
|
||||
marginLeft: checkForIconExistence(guild) ? "20px" : "0"
|
||||
}}>{guild ? guild.name : "View server"} </Text>
|
||||
<ArrowSvg />
|
||||
</div>
|
||||
}
|
||||
</Popout>
|
||||
}
|
||||
</Popout>
|
||||
</>
|
||||
}
|
||||
{
|
||||
channel && <div className={cl("footer-element")} onClick={() => NavigationRouter.transitionTo(`/channels/${guild_id ?? "@me"}/${channel_id}/${message_id}`)} >
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue