-
Notifications
You must be signed in to change notification settings - Fork 11
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
2 changed files
with
44 additions
and
41 deletions.
There are no files selected for viewing
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,48 +1,11 @@ | ||
import Image from 'next/image'; | ||
import DefaultCard from './defaultCard'; | ||
import { ParseMarkdownAndHtml } from '../parseMarkdownAndHtml'; | ||
import ProjectCard from './projectCard'; | ||
|
||
const Card = ({ card }) => { | ||
if (card.data.type !== 'project') { | ||
return <DefaultCard card={card} />; | ||
} else { | ||
return ( | ||
<div className="col-md-4 mb-3" id={card.data.id}> | ||
<div | ||
className="section-main" | ||
style={{ border: `1rem solid ${card.data.color.background}` }} | ||
> | ||
<h3>{card.data.title}</h3> | ||
<div> | ||
<div className="d-flex flex-wrap"> | ||
{card.data.avatarList.map((avatar) => ( | ||
<div | ||
key={avatar.data.title} | ||
className="col-3 avatar avatar-list" | ||
style={{ | ||
backgroundColor: `${avatar.data.color.background}`, | ||
border: `3px solid ${avatar.data.color.border}`, | ||
}} | ||
> | ||
<div | ||
style={{ | ||
backgroundImage: `url(${avatar.data.image})`, | ||
}} | ||
> | ||
| ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
<strong>{card.data.description}</strong> | ||
<ParseMarkdownAndHtml markdown={true}> | ||
{card.content} | ||
</ParseMarkdownAndHtml> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
if (card.data.type === 'project') { | ||
return <ProjectCard card={card} />; | ||
} | ||
return <DefaultCard card={card} />; | ||
}; | ||
|
||
export default Card; |
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,40 @@ | ||
import { ParseMarkdownAndHtml } from '../parseMarkdownAndHtml'; | ||
|
||
const ProjectCard = ({ card }) => ( | ||
<div className="col-md-4 mb-3" id={card.data.id}> | ||
<div | ||
className="section-main" | ||
style={{ border: `1rem solid ${card.data.color.background}` }} | ||
> | ||
<h3>{card.data.title}</h3> | ||
<div> | ||
<div className="d-flex flex-wrap"> | ||
{card.data.avatarList.map((avatar) => ( | ||
<div | ||
key={avatar.data.title} | ||
className="col-3 avatar avatar-list" | ||
style={{ | ||
backgroundColor: `${avatar.data.color.background}`, | ||
border: `3px solid ${avatar.data.color.border}`, | ||
}} | ||
> | ||
<div | ||
style={{ | ||
backgroundImage: `url(${avatar.data.image})`, | ||
}} | ||
> | ||
| ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
<strong>{card.data.description}</strong> | ||
<ParseMarkdownAndHtml markdown={true}> | ||
{card.content} | ||
</ParseMarkdownAndHtml> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default ProjectCard; |