-
-
Save brandonsueur/818c71dbf4f59d4818a8cb089fb57fcd to your computer and use it in GitHub Desktop.
💼 Small code for list my projects ~ Portfolio
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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
const Title = ({ children }) => <h1 className="Title">{children}</h1> | |
const Section = ({ title, children }) => ( | |
<div className="Section"> | |
<Title>{title}</Title> | |
{children} | |
</div> | |
); | |
const Tag = ({ label }) => <span className="Tag">{label}</span> | |
const Project = ({ project }) => ( | |
<div className="Project"> | |
<h2 className="Project-title">{project.title}</h2> | |
{project.tags.map(tag => <Tag key={tag.id} label={tag.label} />) | |
{project.description} | |
</div> | |
); | |
ReactDOM.render( | |
<div> | |
<Section title="Project"> | |
{projects.map(project => <Project key={project.id} project={project} />)} | |
</Section> | |
</div>, | |
document.querySelector("#app-root") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment