Files
medusa-store/www/apps/ui/src/props/code-block.tsx
Kasper Fabricius Kristensen a67a8e7e90 fix(ui): Fixed CodeBlock line number width (#5640)
**What**
- Fixes the width of lineNumbers in the CodeBlock component according to the widest number.
- Introduces a new prop on snippets that allows users to hide the copy button. Also updated docs to reflect this.

Before:
![image](https://github.com/medusajs/medusa/assets/45367945/07852c2e-434c-44df-93b7-4078148cb74f)

After:
<img width="742" alt="image" src="https://github.com/medusajs/medusa/assets/45367945/5ce845f7-b8c7-411c-abfb-fa03448aeb1a">

Closes #5639
2023-11-16 10:50:04 +00:00

21 lines
467 B
TypeScript

import { PropTable } from "@/components/props-table"
import { PropDataMap } from "@/types/props"
const codeBlockProps: PropDataMap = [
{
prop: "snippets",
type: {
type: "object",
name: "CodeSnippet[]",
shape:
"{\n label: string\n language: string\n code: string\n hideLineNumbers?: boolean\n hideCopy?: boolean\n}[]",
},
},
]
const Props = () => {
return <PropTable props={codeBlockProps} />
}
export default Props