Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Button 컴포넌트 children으로 아이콘도 수용 가능하도록 수정 #135

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/many-jobs-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wowds-ui": patch
---

Button 컴포넌트에서 children으로 아이콘도 수용할 수 있도록 합니다.
10 changes: 3 additions & 7 deletions packages/wow-ui/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { cva } from "@styled-system/css/cva";
import { styled } from "@styled-system/jsx";
import { Flex } from "@styled-system/jsx";
import type { CSSProperties, ElementType, ReactNode } from "react";
import { forwardRef } from "react";

Expand Down Expand Up @@ -105,13 +105,9 @@ const Button: ButtonComponent & { displayName?: string } = forwardRef(
onPointerUp={handlePointerUp}
{...rest}
>
<styled.span
{...(typeof children === "string" && {
textStyle: size === "lg" ? "label1" : "label2",
})}
>
<Flex gap="8px" textStyle={size === "lg" ? "label1" : "label2"}>
{children}
</styled.span>
</Flex>
</Component>
);
}
Expand Down
Loading