Added svg badges to projects that have them

This commit is contained in:
mitchelljfs 2018-07-21 19:23:58 -07:00
parent 65c1f85277
commit 34dba26cb3
4 changed files with 66 additions and 2 deletions

View file

@ -16,6 +16,7 @@ class Experience extends React.PureComponent<Props> {
constructor(props: Props) {
super(props)
this.listedBullets = this.props.bullets.map((bullet, index) => (
<li key={index}>{bullet}</li>
))

View file

@ -1,3 +1,8 @@
.project-badge {
display: inline-block;
margin: 3px 2px 0 2px;
}
.project-container {
border-bottom: 2px solid rgb(139, 191, 209);
flex: 1 0 45%;

View file

@ -1,5 +1,5 @@
// @flow
import React from "react"
import * as React from "react"
import ClearButton from "../../components/ClearButton"
@ -8,14 +8,28 @@ import "./index.css"
type Props = {
title: string,
children: string,
repoUrl: string
repoUrl: string,
badges: Array<{ imgUrl: string, linkUrl: string, alt: string }>
}
class Project extends React.PureComponent<Props> {
badges: Array<React.Element<string>>
constructor(props: Props) {
super(props)
this.badges = this.props.badges.map((badge, index) => (
<a className="project-badge" href={badge.linkUrl} key={index}>
<img src={badge.imgUrl} alt={badge.alt} />
</a>
))
}
render() {
return (
<div className="project-container">
<h4>{this.props.title}</h4>
{this.badges}
<p>{this.props.children}</p>
<ClearButton href={this.props.repoUrl}>Repository</ClearButton>
</div>