Skip to content

Commit

Permalink
Replace admonition components (#1840)
Browse files Browse the repository at this point in the history
  • Loading branch information
dayhaysoos authored Oct 15, 2024
1 parent 12b8749 commit 2e85615
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion site-new/src/components/Admonition/Admonition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Note from "@site/assets/icons/Note";
import { cn } from "@site/lib/utils";
import React from "react";

type Variant = "info" | "warning" | "tip" | "danger" | "note";
export type Variant = "info" | "warning" | "tip" | "danger" | "note";

const variantBorderClassesMap: Record<Variant, string> = {
info: "border-tbd-info",
Expand Down
1 change: 1 addition & 0 deletions site-new/src/components/Admonition/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as Admonition } from "./Admonition";
export type { Variant } from "./Admonition";
10 changes: 10 additions & 0 deletions site-new/src/theme/Admonition/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { type ReactNode } from "react";
import { Admonition as CustomAdmonition } from "@site/src/components/Admonition";
import type { Variant } from "@site/src/components/Admonition";

import type { Props } from "@theme/Admonition/Layout";

export default function AdmonitionLayout(props: Props): JSX.Element {
const { type, children } = props;
return <CustomAdmonition variant={type as Variant} children={children} />;
}

0 comments on commit 2e85615

Please sign in to comment.