Created
April 20, 2019 21:50
-
-
Save treyhuffine/fbb1af9596ecd89a3043772af07ecfaf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 * as React from 'react'; | |
import { LaunchListQuery } from '../../generated/graphql'; | |
import './styles.css'; | |
interface Props { | |
data: LaunchListQuery; | |
} | |
const className = 'LaunchList'; | |
const LaunchList: React.FC<Props> = ({ data }) => ( | |
<div className={className}> | |
<h3>Launches</h3> | |
<ol className={`${className}__list`}> | |
{!!data.launches && | |
data.launches.map( | |
(launch, i) => | |
!!launch && ( | |
<li key={i} className={`${className}__item`}> | |
{launch.mission_name} ({launch.launch_year}) | |
</li> | |
), | |
)} | |
</ol> | |
</div> | |
); | |
export default LaunchList; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment