Skip to content

Commit

Permalink
feat: 아이콘 버튼 컴포넌트 구현 (#8)
Browse files Browse the repository at this point in the history
* feat: 기본 버튼 컴포넌트 추가

* feat: 아이콘 컴포넌트 children으로 설정

* feat: index.ts폴더 추가

* refactor: 기본 변수 수정

* refactor: 추가적인 클래스 받도록 설정

* refactor: className추가

* refactor: 불필요한 prop,유틸 제거

* refactor: 수정사항 반영
  • Loading branch information
khj0426 authored Oct 31, 2023
1 parent 1ad72d2 commit 8bd8004
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/assets/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { default as CloseIcon } from './close.svg?react'
export { default as TableSend } from './table_send.svg?react'
export { default as SearchIcon } from './search.svg?react'
export { default as BasicProfileIcon } from './basicProfile.svg?react'

3 changes: 3 additions & 0 deletions src/assets/icons/table_send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { PropsWithChildren } from 'react'
import './IconButton.css'

interface IconButtonProps {
disabled?: boolean
className?: string
text?: string
}

const IconButton = ({
disabled,
className,
children,
text,
}: PropsWithChildren<IconButtonProps>) => {
return (
<button
className={`btn flex h-14 w-36 items-center gap-2 border border-black bg-white text-black ${
disabled ? 'btn-disabled' : ''
} ${className} `}
>
{children}
{text ?? 'Default'}
</button>
)
}

export default IconButton
1 change: 1 addition & 0 deletions src/components/IconButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as IconButton } from './IconButton'
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './IconButton'

export { default as SearchBar } from './SearchBar'
export { default as Profile } from './Profile'

0 comments on commit 8bd8004

Please sign in to comment.