Skip to content

Commit

Permalink
refactor: Typo컴포넌트 default props 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
im-na0 committed Jun 13, 2024
1 parent eb5b8be commit 54ddd4b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/ui/typo/typo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import type {
PolymorphicComponentPropsWithRef,
PolymorphicRef,
} from "../polymorphic";
} from "@components/ui/polymorphic";

export type TextProps<C extends ElementType = "span"> =
PolymorphicComponentPropsWithRef<C, IStyledTextProps & StyledEmEmProps>;
Expand All @@ -19,7 +19,14 @@ export const Typo = forwardRef(function Typo<C extends ElementType = "span">(
props: TextProps<C>,
ref?: PolymorphicRef<C>,
) {
const { as, color, typo, isEllipsis, children, ...rest } = props;
const {
as,
color = "black",
typo = "body1",
isEllipsis = false,
children,
...rest
} = props;

const styledChildren = Children.map(children, (child) => {
if (isValidElement(child) && child.type === "em") {
Expand Down

0 comments on commit 54ddd4b

Please sign in to comment.