Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REV-75/설명 컴포넌트 구현 #10

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/components/PageIntro/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
interface PageIntroProps {
imageSrc?: string
description: string
colorTheme: string
}

const PageIntro = ({ imageSrc, description, colorTheme }: PageIntroProps) => {
const boxDefaultStyle = `border-2 p-4 whitespace-pre-line border-${colorTheme}-500`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace-pre-line 처음 알았습니다!!
배우고 갑니다 🙏

const textDefaultStyle = `text-${colorTheme}-900 text-sm sm:text-base`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

같은 colorTheme이므로 text와 box의 border은 항상 같은 색깔이 되겠군요?
다른 색상이 될 경우는 없겠죠?...🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넹 같은 색깔이 될 것 같아요!


return imageSrc ? (
<div className={`flex items-center gap-x-8 ${boxDefaultStyle}`}>
<img
className="max-w-20 max-h-20 object-cover"
src={imageSrc}
alt="페이지를 소개하는 npc 아이콘"
/>
<p className={`${textDefaultStyle}`}>{description}</p>
</div>
) : (
<div className={`${boxDefaultStyle}`}>
<p className={`${textDefaultStyle}`}>{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
@@ -0,0 +1 @@
export * from './PageIntro'
Loading