Skip to content

Commit 79e18a4

Browse files
authored
Merge pull request #15184 from ethereum/mdxTableComponentsIssue
Mdx table components not rendering issue
2 parents 500bbcc + 3dbd8fc commit 79e18a4

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

public/content/developers/docs/evm/opcodes/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For operations with dynamic gas costs, see [gas.md](https://github.com/wolflo/ev
1818
💡 Quick tip: To view entire lines, use `[shift] + scroll` to scroll horizontally on desktop.
1919

2020
| Stack | Name | Gas | Initial Stack | Resulting Stack | Mem / Storage | Notes |
21-
| :---: | :------------- | :---------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------- | :------------------------------ | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
21+
| :---: | :------------- | :---------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------- | :------------------------------ | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
2222
| 00 | STOP | 0 | | | | halt execution |
2323
| 01 | ADD | 3 | `a, b` | `a + b` | | (u)int256 addition modulo 2\*\*256 |
2424
| 02 | MUL | 5 | `a, b` | `a * b` | | (u)int256 multiplication modulo 2\*\*256 |

src/components/MdComponents/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { ButtonLink } from "../ui/buttons/Button"
2626
import { Divider } from "../ui/divider"
2727
import { Flex } from "../ui/flex"
2828
import { ListItem, OrderedList, UnorderedList } from "../ui/list"
29-
import { mdxTableComponents } from "../ui/table"
29+
import { mdxTableComponents } from "../ui/mdx-table-components"
3030
import { Tag } from "../ui/tag"
3131

3232
export const commonHeadingAttributes = (className: string, id?: string) => ({
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {
2+
Table,
3+
TableBody,
4+
TableCell,
5+
TableHead,
6+
TableHeader,
7+
TableRow,
8+
} from "./table"
9+
10+
export const mdxTableComponents = {
11+
table: Table,
12+
td: ({ align, ...rest }) => <TableCell align={align} {...rest} />,
13+
th: ({ align, ...rest }) => <TableHead align={align} {...rest} />,
14+
tr: (props) => <TableRow {...props} />,
15+
tbody: (props) => <TableBody {...props} />,
16+
thead: (props) => <TableHeader {...props} />,
17+
}

src/components/ui/table.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,7 @@ const TableCaption = React.forwardRef<
180180
))
181181
TableCaption.displayName = "TableCaption"
182182

183-
const mdxTableComponents = {
184-
table: Table,
185-
td: ({ align, ...rest }) => <TableCell align={align} {...rest} />,
186-
th: ({ align, ...rest }) => <TableHead align={align} {...rest} />,
187-
tr: (props) => <TableRow {...props} />,
188-
tbody: (props) => <TableBody {...props} />,
189-
thead: (props) => <TableHeader {...props} />,
190-
}
191-
192183
export {
193-
mdxTableComponents,
194184
Table,
195185
TableBody,
196186
TableCaption,

src/layouts/Docs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Translation from "@/components/Translation"
2828
import { ButtonLink } from "@/components/ui/buttons/Button"
2929
import { Divider } from "@/components/ui/divider"
3030
import InlineLink from "@/components/ui/Link"
31-
import { mdxTableComponents } from "@/components/ui/table"
31+
import { mdxTableComponents } from "@/components/ui/mdx-table-components"
3232
import YouTube from "@/components/YouTube"
3333

3434
import { cn } from "@/lib/utils/cn"

src/layouts/Tutorial.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import TableOfContents from "@/components/TableOfContents"
2222
import TooltipLink from "@/components/TooltipLink"
2323
import TutorialMetadata from "@/components/TutorialMetadata"
2424
import { ButtonLink } from "@/components/ui/buttons/Button"
25-
import { mdxTableComponents } from "@/components/ui/table"
25+
import { mdxTableComponents } from "@/components/ui/mdx-table-components"
2626
import YouTube from "@/components/YouTube"
2727

2828
import { getEditPath } from "@/lib/utils/editPath"

0 commit comments

Comments
 (0)