From f7d9f93c943e86eb9f38b3cbc8cbc4b0c9b7c480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gromit=20=28=EC=A0=84=EB=AF=BC=EC=9E=AC=29?= <64779472+ssi02014@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:21:13 +0900 Subject: [PATCH] =?UTF-8?q?fix(react):=20AspectRatio=20=EC=9D=B8=ED=84=B0?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=8A=A4=20=EB=B0=8F=20=EB=82=B4=EB=B6=80=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EA=B0=9C=EC=84=A0=20(#597)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/polite-apes-rush.md | 5 ++ docs/docs/react/components/AspectRatio.mdx | 44 +++-------------- .../src/components/AspectRatio/index.tsx | 48 +++++-------------- 3 files changed, 23 insertions(+), 74 deletions(-) create mode 100644 .changeset/polite-apes-rush.md diff --git a/.changeset/polite-apes-rush.md b/.changeset/polite-apes-rush.md new file mode 100644 index 000000000..f7a8a8bd4 --- /dev/null +++ b/.changeset/polite-apes-rush.md @@ -0,0 +1,5 @@ +--- +'@modern-kit/react': patch +--- + +fix(react): AspectRatio 인터페이스 및 내부 로직 개선 - @ssi0214 diff --git a/docs/docs/react/components/AspectRatio.mdx b/docs/docs/react/components/AspectRatio.mdx index aca873f62..0f5d617ec 100644 --- a/docs/docs/react/components/AspectRatio.mdx +++ b/docs/docs/react/components/AspectRatio.mdx @@ -14,21 +14,22 @@ import { AspectRatio } from '@modern-kit/react'; ## Interface ```ts title="typescript" -interface AspectRatioProps extends ComponentProps<'div'> { - asChild?: boolean; +interface AspectRatioProps { + children: JSX.Element; ratio: number; } ``` +```tsx title="typescript" +const AspectRatio: ({ ratio, children }: AspectRatioProps) => JSX.Element; +``` ## Usage -### Basic -- 기본적으로 div 태그를 부모로 두고 자식 요소를 렌더링 하며, div 태그에 aspect-ratio 속성을 적용합니다. ```tsx title="typescript" import { AspectRatio } from '@modern-kit/react' const Example = () => { return ( -