Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasribeiroo committed Oct 22, 2023
1 parent daa71b3 commit d3ffb8c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
4 changes: 2 additions & 2 deletions apps/guide/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export default makeSource({
rehypeAutolinkHeadings,
{
properties: {
className:
'relative group inline-flex justify-center items-center outline-none pr-2 ml-2 opacity-0 hover:opacity-100',
className:
'relative group inline-flex justify-center items-center outline-none pr-2 ml-2 opacity-0 hover:opacity-100',
},
behavior: 'append',
content: (heading: any) => [
Expand Down
4 changes: 2 additions & 2 deletions apps/guide/src/components/copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface CopyButtonProps extends HTMLAttributes<HTMLButtonElement> {
event?: Event['name'];
}

export function CopyButton({ value, className, src, event, ...props }: CopyButtonProps) {
export function CopyButton({ value, className, event, ...props }: CopyButtonProps) {
const [hasCopied, setHasCopied] = useState(false);

useEffect(() => {
Expand Down Expand Up @@ -84,7 +84,7 @@ export function CopyNpmCommandButton({ commands, className, ...props }: CopyNpmC

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<DropdownMenuTrigger {...props} asChild>
<Button
size="icon"
variant="ghost"
Expand Down
7 changes: 6 additions & 1 deletion apps/guide/src/components/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ const components = {
<h6 className={cn('mt-8 scroll-m-20 text-base font-semibold tracking-tight', className)} {...props} />
),
a: ({ className, ...props }: HTMLAttributes<HTMLAnchorElement>) => (
<a className={cn('font-medium underline underline-offset-4', className)} {...props} />
<a
className={cn('font-medium underline underline-offset-4', className)}
target="_blank"
rel="noopener noreferrer"
{...props}
/>
),
p: ({ className, ...props }: HTMLAttributes<HTMLParagraphElement>) => (
<p className={cn('leading-7 [&:not(:first-child)]:mt-6', className)} {...props} />
Expand Down
39 changes: 18 additions & 21 deletions apps/guide/src/components/ui/discord-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,35 @@ export interface DiscordMessageProps {
readonly replyNode?: ReactNode | undefined;
}

export function DiscordMessage({
reply,
replyNode,
interaction,
interactionNode,
author,
authorNode,
followUp,
children,
}: PropsWithChildren<DiscordMessageProps>) {
export function DiscordMessage(props: PropsWithChildren<DiscordMessageProps>) {
return (
<div className="relative">
<div className={cn('pl-18 hover:bg-[rgb(4_4_5)]/7 py-0.5 pr-12 leading-snug', followUp ? '' : 'mt-4')}>
{(reply || replyNode) && !followUp ? reply ? <DiscordMessageReply {...reply} /> : replyNode ?? null : null}
{(interaction || interactionNode) && !(reply || replyNode) && !followUp ? (
interaction ? (
<DiscordMessageInteraction {...interaction} />
<div className={cn('pl-18 hover:bg-[rgb(4_4_5)]/7 py-0.5 pr-12 leading-snug', props.followUp ? '' : 'mt-4')}>
{(props.reply || props.replyNode) && !props.followUp ? (
props.reply ? (
<DiscordMessageReply {...props.reply} />
) : (
interactionNode ?? null
props.replyNode ?? null
)
) : null}
{(props.interaction || props.interactionNode) && !(props.reply || props.replyNode) && !props.followUp ? (
props.interaction ? (
<DiscordMessageInteraction {...props.interaction} />
) : (
props.interactionNode ?? null
)
) : null}
<div className="static">
{followUp ? (
{props.followUp ? (
<span className="absolute left-0 mr-1 hidden h-5.5 w-[56px] cursor-default select-none text-right text-xs leading-loose text-[rgb(163_166_170)] group-hover:inline-block">
{new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' })}
</span>
) : author ? (
<DiscordMessageAuthor {...author} />
) : props.author ? (
<DiscordMessageAuthor {...props.author} />
) : (
authorNode
props.authorNode
)}
<div className="text-white [&>p]:m-0 [&>p]:leading-snug">{children}</div>
<div className="text-white [&>p]:m-0 [&>p]:leading-snug">{props.children}</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/content/test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (let i = 0; i < 10; i++) {
```

```bash
npm install darkcord
npm install darkcord
```

## Test discord components
Expand Down

0 comments on commit d3ffb8c

Please sign in to comment.