Skip to content

Commit

Permalink
docs: remove duplicate buttons in code actions (#10061)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Nov 13, 2024
1 parent e10fb34 commit 1d87459
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type CodeBlockHeaderProps = {
title?: string
blockStyle?: CodeBlockStyle
actionsProps: CodeBlockActionsProps
hideActions?: boolean
} & CodeBlockHeaderMeta

export const CodeBlockHeader = ({
Expand All @@ -25,6 +26,7 @@ export const CodeBlockHeader = ({
badgeLabel,
actionsProps,
badgeColor,
hideActions = false
}: CodeBlockHeaderProps) => {
const { colorMode } = useColorMode()

Expand Down Expand Up @@ -54,7 +56,7 @@ export const CodeBlockHeader = ({
</div>
)}
</div>
<CodeBlockActions {...actionsProps} />
{!hideActions && <CodeBlockActions {...actionsProps} />}
</CodeBlockHeaderWrapper>
)
}
1 change: 1 addition & 0 deletions www/packages/docs-ui/src/components/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export const CodeBlock = ({
...actionsProps,
inHeader: true,
}}
hideActions={hasTabs}
/>
)}
<div
Expand Down

0 comments on commit 1d87459

Please sign in to comment.