File tree Expand file tree Collapse file tree 3 files changed +35
-3
lines changed
Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 1+ interface LinkBarProps {
2+ link : string ;
3+ onClick ?: ( ) => void ;
4+ }
5+
6+ /**
7+ * 링크 주소를 표시하는 컴포넌트
8+ * @param link 링크 주소
9+ * @param onClick 링크 클릭 시 실행할 함수
10+ */
11+ export default function LinkBar ( { link, onClick } : LinkBarProps ) {
12+ return (
13+ < button
14+ type = "button"
15+ onClick = { onClick }
16+ className = "flex cursor-pointer items-center gap-[5px] rounded-custom bg-green-100 px-[10px] py-[3px] mo:py-1"
17+ >
18+ < img
19+ src = "icon/icon-link.svg"
20+ alt = "링크 아이콘"
21+ className = "h-5 w-5 mo:h-4 mo:w-4"
22+ />
23+ < p className = "text-14 text-green-200 mo:text-12" > { link } </ p >
24+ </ button >
25+ ) ;
26+ }
Original file line number Diff line number Diff line change 11import Button from '@/components/Button' ;
2+ import LinkBar from '@/components/LinkBar' ;
23
34export default function Test ( ) {
45 const commonCellClass = 'border-r border-gray-300' ;
@@ -14,7 +15,7 @@ export default function Test() {
1415 </ tr >
1516 </ thead >
1617 < tbody >
17- < tr >
18+ < tr className = "border-b border-gray-300" >
1819 < td className = { commonCellClass } > Button</ td >
1920 < td className = { commonRowClass } >
2021 < Button size = "small" > small</ Button >
@@ -33,8 +34,10 @@ export default function Test() {
3334 </ td >
3435 </ tr >
3536 < tr >
36- < td className = { commonCellClass } > 컴포넌트명 입력</ td >
37- < td className = { commonRowClass } > { /* 컴포넌트를 추가해주세요 */ } </ td >
37+ < td className = { commonCellClass } > LinkBar</ td >
38+ < td className = { commonRowClass } >
39+ < LinkBar link = "https://www.google.com" />
40+ </ td >
3841 </ tr >
3942 </ tbody >
4043 </ table >
You can’t perform that action at this time.
0 commit comments