refactor #5
@ -1,4 +1,5 @@
|
|||||||
import { Link } from "@/components/common/Link";
|
import { Link } from "@/components/common/Link";
|
||||||
|
import React from "react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
const variantStyles = {
|
const variantStyles = {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { ClipboardDocumentIcon } from "@heroicons/react/24/outline";
|
import { ClipboardDocumentIcon } from "@heroicons/react/24/outline";
|
||||||
import { prismThemes } from "@/data/themes/prism";
|
import { prismThemes } from "@/data/themes/prism";
|
||||||
|
import React, { Fragment, useMemo } from "react";
|
||||||
import { Highlight } from "prism-react-renderer";
|
import { Highlight } from "prism-react-renderer";
|
||||||
import { useTheme } from "@/hooks/useTheme";
|
import { useTheme } from "@/hooks/useTheme";
|
||||||
import { Fragment, useMemo } from "react";
|
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import { Button } from "./Button";
|
import { Button } from "./Button";
|
||||||
import Prism from "prismjs";
|
import Prism from "prismjs";
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Icon } from "@syntax/Icon";
|
import { Icon } from "@syntax/Icon";
|
||||||
|
import React from "react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { usePageContext } from "vike-react/usePageContext";
|
import { usePageContext } from "vike-react/usePageContext";
|
||||||
import { ClockIcon } from "@heroicons/react/24/outline";
|
import { ClockIcon } from "@heroicons/react/24/outline";
|
||||||
import { navigation } from "@/lib/navigation";
|
import { navigation } from "@/lib/navigation";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
type DocsHeaderProps = {
|
type DocsHeaderProps = {
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { PrevNextLinks } from "@syntax/PrevNextLinks";
|
|||||||
import { collectSections } from "@/lib/sections";
|
import { collectSections } from "@/lib/sections";
|
||||||
import { DocsHeader } from "@syntax/DocsHeader";
|
import { DocsHeader } from "@syntax/DocsHeader";
|
||||||
import { Prose } from "@syntax/Prose";
|
import { Prose } from "@syntax/Prose";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
export function DocsLayout({
|
export function DocsLayout({
|
||||||
children,
|
children,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { clientOnly } from "vike-react/clientOnly";
|
import { clientOnly } from "vike-react/clientOnly";
|
||||||
import { SSRSnippet } from "./SSRSnippet";
|
import { SSRSnippet } from "./SSRSnippet";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
const CSRSnippet = clientOnly(() => import("./CSRSnippet"));
|
const CSRSnippet = clientOnly(() => import("./CSRSnippet"));
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import blurIndigoImage from "@/images/blur-indigo.webp";
|
|||||||
import blurCyanImage from "@/images/blur-cyan.webp";
|
import blurCyanImage from "@/images/blur-cyan.webp";
|
||||||
import { Image } from "@/components/common/Image";
|
import { Image } from "@/components/common/Image";
|
||||||
import { Highlight } from "prism-react-renderer";
|
import { Highlight } from "prism-react-renderer";
|
||||||
|
import React, { Fragment } from "react";
|
||||||
import { Button } from "@syntax/Button";
|
import { Button } from "@syntax/Button";
|
||||||
import { Fragment } from "react";
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
const codeLanguage = "javascript";
|
const codeLanguage = "javascript";
|
||||||
|
|||||||
@ -32,8 +32,8 @@ export function Icon({
|
|||||||
color?: keyof typeof iconStyles;
|
color?: keyof typeof iconStyles;
|
||||||
icon: keyof typeof icons;
|
icon: keyof typeof icons;
|
||||||
} & Omit<React.ComponentPropsWithoutRef<"svg">, "color">) {
|
} & Omit<React.ComponentPropsWithoutRef<"svg">, "color">) {
|
||||||
let id = useId();
|
const id = useId();
|
||||||
let IconComponent = icons[icon];
|
const IconComponent = icons[icon];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<svg aria-hidden="true" viewBox="0 0 32 32" fill="none" className={clsx(className, iconStyles[color])} {...props}>
|
<svg aria-hidden="true" viewBox="0 0 32 32" fill="none" className={clsx(className, iconStyles[color])} {...props}>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user