Skip to content

Commit 759fb04

Browse files
authored
Merge pull request #16 from CAPSTONE-DBFIS/DF-76-shared-text
feat: shared Text UI 제작
2 parents 501ce77 + 15749ce commit 759fb04

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/app/token/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './token';

src/shared/ui/Text/Text.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { colors, fontSizes } from "@/app/token";
2+
import { Box } from "../Box";
3+
4+
type ValidElements = "p" | "span" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
5+
6+
interface TextProps {
7+
as?: ValidElements;
8+
children?: React.ReactNode;
9+
fontSize: keyof typeof fontSizes;
10+
color: keyof typeof colors;
11+
className?: string;
12+
style? : unknown;
13+
}
14+
15+
export const Text = ({as = "span", children, fontSize, color, className, style}: TextProps) => {
16+
return (
17+
<Box as={as} fontSize={fontSize} color={color} className={`${className} ${style}`}>
18+
{children}
19+
</Box>
20+
);
21+
}

src/shared/ui/Text/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Text';

0 commit comments

Comments
 (0)