From f2f3ba8ca50cef9a3dfe46f322b5e5e0741a18e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=98=88=EC=A7=84?= Date: Sun, 19 Nov 2023 00:44:51 +0900 Subject: [PATCH] fix: fix type errors --- src/components/mdx/CodeBlock.tsx | 10 +++++----- src/styles/theme.ts | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/mdx/CodeBlock.tsx b/src/components/mdx/CodeBlock.tsx index b5a0692..bc482f9 100644 --- a/src/components/mdx/CodeBlock.tsx +++ b/src/components/mdx/CodeBlock.tsx @@ -1,14 +1,14 @@ -import { Highlight, themes } from "prism-react-renderer"; +import {Highlight, themes} from "prism-react-renderer"; import styled from "styled-components"; -import { ReactElement } from "react"; -export default function CodeBlock(props: { children: ReactElement }) { - const className = props.children.props.className || ""; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export default function CodeBlock(props: any) { + const className = props.children?.props.className || ""; const matches = className.match(/language-(?.*)/); return ( = { +const defaultTheme = { fontSizes: { tiny: "12px", s: "14px", @@ -90,12 +90,12 @@ const defaultTheme: Omit = { code: 1.6, }, media: { - mobile: (...args) => css` + mobile: (...args: RuleSet) => css` @media only screen and (max-width: 800px) { ${args} } `, - desktop: (...args) => css` + desktop: (...args: RuleSet) => css` @media only screen and (min-width: 800px) { ${args} }