Skip to content

Commit

Permalink
quick actions offset change
Browse files Browse the repository at this point in the history
  • Loading branch information
jay3332 committed Jul 19, 2024
1 parent 306c4aa commit 3b441e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/messaging/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,16 @@ function QuickActionButton(
)
}

function QuickActions(props: { message: Message, guildId?: bigint, grouper: MessageGrouper }) {
function QuickActions(props: { message: Message, offset?: number, guildId?: bigint, grouper: MessageGrouper }) {
const contextMenu = useContextMenu()
const permissions = createMemo(() =>
props.guildId ? getApi()?.cache?.getClientPermissions(props.guildId, props.message.channel_id) : null
)
return (
<div class="absolute right-3 -top-5 rounded-full bg-bg-0/80 p-0.5 z-[100] hidden group-hover:flex">
<div
class="absolute backdrop-blur right-3 rounded-full bg-bg-0/80 p-0.5 z-[100] hidden group-hover:flex"
style={{ top: `-${(props.offset ?? 4) * 4}px` }}
>
<Show when={!permissions() || permissions()!.has('ADD_REACTIONS')}>
<QuickActionButton icon={FaceSmile} tooltip="Add Reaction" />
</Show>
Expand Down Expand Up @@ -971,7 +974,7 @@ export default function Chat(props: { channelId: bigint, guildId?: bigint, title
<MessageContextMenu message={message} guildId={props.guildId} editing={editing} />
)}
>
<QuickActions message={message} guildId={props.guildId} grouper={grouper()} />
<QuickActions message={message} offset={9} guildId={props.guildId} grouper={grouper()} />
<span
class="invisible text-center group-hover:visible text-[0.65rem] text-fg/40"
classList={{ [api.cache?.isMentionedIn(message) ? 'w-[60px]' : 'w-[62px]']: true }}
Expand Down

0 comments on commit 3b441e6

Please sign in to comment.