-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
'use client'; | ||
|
||
import Icon from '../components/Icon'; | ||
|
||
const Home = () => { | ||
return <main></main>; | ||
return ( | ||
// 아래는 예시 사용방법입니다. | ||
<div className='flex w-full flex-row items-center justify-center gap-4 px-4'> | ||
<Icon id='chat' /> | ||
<Icon id='home' /> | ||
<Icon id='user' /> | ||
<Icon id='add' /> | ||
<Icon id='comment' size={16} /> | ||
<Icon id='heart' size={16} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { ComponentProps } from 'react'; | ||
|
||
import { IconName } from './type'; | ||
|
||
interface IconProps extends Omit<ComponentProps<'svg'>, 'width' | 'height'> { | ||
id: IconName; | ||
size?: number; | ||
} | ||
|
||
const Icon = ({ id, size = 20, ...props }: IconProps) => { | ||
return ( | ||
<svg width={size} height={size} {...props}> | ||
<use href={`/icon-sprite.svg#${id}`} /> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default Icon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type IconName = 'heart' | 'home' | 'user' | 'comment' | 'chat' | 'add'; |