mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
fix(ui): author and reply author spacing
This commit is contained in:
@@ -126,6 +126,28 @@ export const Default = {
|
|||||||
>
|
>
|
||||||
Interactions are supported! I definitely used a command.
|
Interactions are supported! I definitely used a command.
|
||||||
</DiscordMessage>
|
</DiscordMessage>
|
||||||
|
<DiscordMessage
|
||||||
|
author={{
|
||||||
|
avatar: '/assets/discordjs.png',
|
||||||
|
bot: true,
|
||||||
|
verified: true,
|
||||||
|
color: 'text-red-500',
|
||||||
|
time: 'Today at 21:04',
|
||||||
|
username: 'Guide Bot',
|
||||||
|
}}
|
||||||
|
reply={{
|
||||||
|
author: {
|
||||||
|
avatar: '/assets/snek-bot.jpeg',
|
||||||
|
bot: true,
|
||||||
|
verified: true,
|
||||||
|
color: 'text-blue-500',
|
||||||
|
username: 'Snek Bot',
|
||||||
|
},
|
||||||
|
content: 'You can also have verified bots, like me!',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Display colors are supported as well!
|
||||||
|
</DiscordMessage>
|
||||||
</DiscordMessages>
|
</DiscordMessages>
|
||||||
),
|
),
|
||||||
args: {
|
args: {
|
||||||
|
|||||||
@@ -17,14 +17,17 @@ export function DiscordMessageAuthor({ avatar, bot, verified, color, time, usern
|
|||||||
className="absolute left-[16px] mt-0.5 h-10 w-10 cursor-pointer select-none rounded-full"
|
className="absolute left-[16px] mt-0.5 h-10 w-10 cursor-pointer select-none rounded-full"
|
||||||
src={avatar}
|
src={avatar}
|
||||||
/>
|
/>
|
||||||
<h2 className="m-0 text-size-inherit font-medium leading-snug" id="user-info">
|
<h2 className="m-0 flex place-items-center text-size-inherit font-medium leading-snug" id="user-info">
|
||||||
<span className="mr-1" id="username">
|
<span className="inline-flex place-items-center" id="username">
|
||||||
<span className={`cursor-pointer text-base font-medium hover:underline ${color ?? 'text-white'}`}>
|
<span className={`mr-1.5 cursor-pointer text-base font-medium hover:underline ${color ?? 'text-white'}`}>
|
||||||
{username}
|
{username}
|
||||||
</span>
|
</span>
|
||||||
{bot ? (
|
{bot ? (
|
||||||
<span className="relative top-1 ml-1 rounded bg-blurple px-1 vertical-top text-xs text-white" id="bot">
|
<span
|
||||||
{verified ? <FiCheck className="mr-1 inline-block" /> : null}BOT
|
className="mr-1 inline-flex place-items-center rounded bg-blurple px-1 vertical-top text-[0.7rem]/4 font-normal text-white"
|
||||||
|
id="bot"
|
||||||
|
>
|
||||||
|
{verified ? <FiCheck className="mr-0.5 inline-block stroke-3" /> : null} BOT
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -11,10 +11,13 @@ export interface IDiscordMessageAuthorReply {
|
|||||||
export function DiscordMessageAuthorReply({ avatar, bot, verified, color, username }: IDiscordMessageAuthorReply) {
|
export function DiscordMessageAuthorReply({ avatar, bot, verified, color, username }: IDiscordMessageAuthorReply) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<img alt={`${username}'s avatar`} className="mr-1 h-4 w-4 select-none rounded-full" src={avatar} />
|
<img alt={`${username}'s avatar`} className="mr-1.5 h-4 w-4 select-none rounded-full" src={avatar} />
|
||||||
{bot ? (
|
{bot ? (
|
||||||
<div className="mr-1 rounded bg-blurple px-1 vertical-top text-xs text-white" id="bot">
|
<div
|
||||||
{verified ? <FiCheck className="mr-1 inline-block" /> : null}BOT
|
className="mr-1 inline-flex place-items-center rounded bg-blurple px-1 vertical-top text-[0.7rem]/4 font-normal text-white"
|
||||||
|
id="bot"
|
||||||
|
>
|
||||||
|
{verified ? <FiCheck className="mr-0.5 inline-block stroke-3" /> : null} BOT
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<span className={`mr-1 cursor-pointer select-none text-sm font-medium leading-snug ${color ?? 'text-white'}`}>
|
<span className={`mr-1 cursor-pointer select-none text-sm font-medium leading-snug ${color ?? 'text-white'}`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user