Add basic typing to config objects
Also fixed the blips to be clickable
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { formatRelease } from '../../date';
|
||||
import { featuredOnly, Item } from '../../model';
|
||||
import { featuredOnly, Item, HomepageOption } from '../../model';
|
||||
import HeroHeadline from '../HeroHeadline/HeroHeadline';
|
||||
import QuadrantGrid from '../QuadrantGrid/QuadrantGrid';
|
||||
import RadarGrid from '../RadarGrid/RadarGrid';
|
||||
import Fadeable from '../Fadeable/Fadeable';
|
||||
import SetTitle from '../SetTitle';
|
||||
import { radarName, radarNameShort } from '../../config';
|
||||
import { radarName, radarNameShort, homepageContent } from '../../config';
|
||||
import { MomentInput } from 'moment';
|
||||
|
||||
type PageIndexProps = {
|
||||
@@ -19,16 +19,20 @@ type PageIndexProps = {
|
||||
export default function PageIndex({ leaving, onLeave, items, releases }: PageIndexProps) {
|
||||
const newestRelease = releases.slice(-1)[0];
|
||||
const numberOfReleases = releases.length;
|
||||
const showChart = homepageContent === HomepageOption.chart || homepageContent === HomepageOption.both;
|
||||
const showColumns = homepageContent === HomepageOption.columns || homepageContent === HomepageOption.both;
|
||||
return (
|
||||
<Fadeable leaving={leaving} onLeave={onLeave}>
|
||||
<SetTitle title={radarNameShort} />
|
||||
<div className='headline-group'>
|
||||
<HeroHeadline alt={`Version #${numberOfReleases}`}>{radarName}</HeroHeadline>
|
||||
</div>
|
||||
<RadarGrid blips={featuredOnly(items)} />
|
||||
{/*
|
||||
<QuadrantGrid items={featuredOnly(items)} />
|
||||
*/}
|
||||
{showChart && (
|
||||
<RadarGrid blips={featuredOnly(items)} />
|
||||
)}
|
||||
{showColumns && (
|
||||
<QuadrantGrid items={featuredOnly(items)} />
|
||||
)}
|
||||
<div className='publish-date'>Published {formatRelease(newestRelease)}</div>
|
||||
</Fadeable>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user