Skip to content

Commit 9975869

Browse files
committed
Implement contextMenus
1 parent 54e7fe1 commit 9975869

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/react/src/components/DiscordInteraction.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export type DiscordInteractionProps = {
1515
ephemeral?: boolean
1616
highlight?: boolean
1717
profile?: string
18-
roleColor?: string
18+
roleColor?: string,
19+
contextMenu?: boolean,
1920
} & PropsWithSlot
2021

2122
export default function DiscordInteraction({
@@ -28,6 +29,7 @@ export default function DiscordInteraction({
2829
highlight,
2930
profile: profileKey,
3031
roleColor,
32+
contextMenu,
3133
}: DiscordInteractionProps): ReactElement {
3234
const options: DiscordMessageOptions = useContext(DiscordOptionsContext) ?? DiscordDefaultOptions
3335

@@ -48,11 +50,13 @@ export default function DiscordInteraction({
4850
bot={user.bot}
4951
roleColor={user.roleColor}
5052
/>
51-
{command
52-
? <span className="discord-interaction-command">
53+
{command || contextMenu
54+
? <span className={`discord-interaction-command${contextMenu
55+
? ' discord-interaction-context-menu'
56+
: ''}`}>
5357
used{' '}
5458
<span className="discord-interaction-command-name">
55-
/{children}
59+
{contextMenu ? '' : '/'}{children}
5660
</span>
5761
</span>
5862
: <span className="discord-interaction-reply">

0 commit comments

Comments
 (0)