Skip to content

Commit

Permalink
feat: 설명 컴포넌트 구현 (#10)
Browse files Browse the repository at this point in the history
* feat: 설명 컴포넌트 구현

* refactor: 수정 사항 반영
  • Loading branch information
hyoribogo authored Oct 31, 2023
1 parent 7d97f67 commit ed3faa5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/components/PageIntro/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
interface PageIntroProps {
imageSrc?: string
description: string
className?: string
}

const PageIntro = ({
imageSrc,
description,
className = '',
}: PageIntroProps) => {
return (
<div
className={`flex items-center gap-x-8 whitespace-pre-line border-2 p-4 ${className}`}
>
{imageSrc && (
<img
className="max-w-20 max-h-20 object-cover"
src={imageSrc}
alt="페이지를 소개하는 npc 아이콘"
/>
)}
<p className={`text-sm sm:text-base`}>{description}</p>
</div>
)
}

export default PageIntro
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as PageIntro } from './PageIntro'
export { default as Profile } from './Profile'

Check failure on line 2 in src/components/index.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Duplicate identifier 'Profile'.
export { default as UserList } from './UserList'
export { default as PersonalAnswer } from './PersonalAnswer'
Expand Down

0 comments on commit ed3faa5

Please sign in to comment.