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 { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
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";
|
import { ArrowSvg, checkForIconExistence, cl, ServerProfileComponent } from "./utils";
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "MoreForwardMeta",
|
name: "BetterForwardMeta",
|
||||||
description: "Show server profile under forwarded messages (if available) and always show time",
|
description: "Access server profile under forwarded messages (if available) and always show time",
|
||||||
authors: [Devs.nin0dev],
|
authors: [Devs.nin0dev],
|
||||||
ForwardFooter(message: any) {
|
ForwardFooter(message: any) {
|
||||||
const { guild_id, channel_id, message_id } = message.message.messageReference;
|
const { guild_id, channel_id, message_id } = message.message.messageReference;
|
||||||
|
@ -23,26 +23,30 @@ export default definePlugin({
|
||||||
|
|
||||||
return <div className={cl("footer")} >
|
return <div className={cl("footer")} >
|
||||||
{
|
{
|
||||||
guild_id && <Popout
|
guild_id && <>
|
||||||
position="top"
|
{
|
||||||
renderPopout={() => <ServerProfileComponent guildId={guild_id} />}
|
guild_id !== SelectedGuildStore.getGuildId() && <Popout
|
||||||
>
|
position="top"
|
||||||
{popoutProps => <div className={cl("footer-element")} {...popoutProps}>
|
renderPopout={() => <ServerProfileComponent guildId={guild_id} />}
|
||||||
{
|
>
|
||||||
checkForIconExistence(guild) && <img src={guild.icon && IconUtils.getGuildIconURL({
|
{popoutProps => <div className={cl("footer-element")} {...popoutProps}>
|
||||||
id: guild.id,
|
{
|
||||||
icon: guild.icon,
|
checkForIconExistence(guild) && <img src={guild.icon && IconUtils.getGuildIconURL({
|
||||||
canAnimate: true,
|
id: guild.id,
|
||||||
size: 32
|
icon: guild.icon,
|
||||||
})} alt={`Server icon for ${guild.name}`} className={cl("guild-icon")} />
|
canAnimate: true,
|
||||||
}
|
size: 32
|
||||||
<Text variant="text-sm/medium" className={cl("footer-text")} style={{
|
})} alt={`Server icon for ${guild.name}`} className={cl("guild-icon")} />
|
||||||
marginLeft: checkForIconExistence(guild) ? "20px" : "0"
|
}
|
||||||
}}>{guild ? guild.name : "View server"} </Text>
|
<Text variant="text-sm/medium" className={cl("footer-text")} style={{
|
||||||
<ArrowSvg />
|
marginLeft: checkForIconExistence(guild) ? "20px" : "0"
|
||||||
</div>
|
}}>{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}`)} >
|
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