1- import React from 'react'
21import { PageLayout } from './PageLayout'
32import { DrawingTile } from './DrawingTile'
43import styled from 'styled-components'
54import { YearBar } from './YearBar'
6- import { dayDrawingSetsByYear } from '../__fixtures__/drawings '
5+ import { yearDrawingSets } from '../__fixtures__'
76
87export const YearPage : React . FC < { year : number } > = ( { year } ) => {
9- const dayDrawingSets = dayDrawingSetsByYear [ year ]
10- const dates = Object . keys ( dayDrawingSets )
8+ const drawings = yearDrawingSets [ year ]
119 return (
1210 < PageLayout title = { `explodingdog ${ year } ` } >
1311 < YearBar activeYear = { year } />
1412 < YearHeading > { year } </ YearHeading >
1513 < DrawingSection >
16- { dates . map ( date => (
17- < DrawingDate >
18- < DrawingDateHeading > { date } </ DrawingDateHeading >
19- < DrawingDateTiles >
20- { dayDrawingSets [ date ] . map ( drawing => (
21- < DrawingTile key = { `${ drawing . date } ${ drawing . slug } ` } { ...drawing } />
22- ) ) }
23- </ DrawingDateTiles >
24- </ DrawingDate >
14+ { drawings && drawings . map ( drawing => (
15+ < DrawingTile key = { `${ drawing . date } ${ drawing . slug } ` } { ...drawing } />
2516 ) ) }
2617 </ DrawingSection >
2718 </ PageLayout >
@@ -36,18 +27,3 @@ const YearHeading = styled.h1.attrs({ className: 'Explorer__YearPage__YearHeadin
3627const DrawingSection = styled . section . attrs ( { className : 'Explorer__YearPage__DrawingSection' } ) `
3728 text-align: center;
3829`
39-
40- const DrawingDate = styled . div . attrs ( { className : 'Explorer__YearPage__DrawingDate' } ) `
41- margin: 24px 0 48px;
42- `
43-
44- const DrawingDateHeading = styled . h3 . attrs ( { className : 'Explorer__YearPage__DrawingDateHeading' } ) `
45- align-items: center;
46- color: #BBB;
47- display: flex;
48- height: 48px;
49- justify-content: center;
50- margin: 0;
51- `
52-
53- const DrawingDateTiles = styled . div . attrs ( { className : 'Explorer__YearPage__DrawingDateTiles' } ) ``
0 commit comments