[examples/538][sm] - bug fixes + favicon
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
import { Html, Head, Main, NextScript } from 'next/document'
|
import { Html, Head, Main, NextScript } from 'next/document';
|
||||||
|
|
||||||
export default function Document() {
|
export default function Document() {
|
||||||
return (
|
return (
|
||||||
<Html lang="en">
|
<Html lang="en">
|
||||||
<Head />
|
<Head>
|
||||||
|
<link
|
||||||
|
rel="icon"
|
||||||
|
type="image/x-icon"
|
||||||
|
href="https://projects.fivethirtyeight.com/shared/favicon.ico"
|
||||||
|
/>
|
||||||
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
</body>
|
</body>
|
||||||
</Html>
|
</Html>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
||||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
|
||||||
|
|
||||||
type Data = {
|
|
||||||
name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function handler(
|
|
||||||
req: NextApiRequest,
|
|
||||||
res: NextApiResponse<Data>
|
|
||||||
) {
|
|
||||||
res.status(200).json({ name: 'John Doe' })
|
|
||||||
}
|
|
||||||
@@ -25,7 +25,7 @@ export function MobileItem({dataset} : { dataset: Dataset}) {
|
|||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<span className="font-light">{dataset.name}</span>
|
<span className="font-light">{dataset.name}</span>
|
||||||
{dataset.articles.map((article) => (
|
{dataset.articles.map((article) => (
|
||||||
<div className='py-1 flex flex-col'>
|
<div key={article.title} className='py-1 flex flex-col'>
|
||||||
<span className="font-bold hover:underline">{article.title}</span>
|
<span className="font-bold hover:underline">{article.title}</span>
|
||||||
<span className="font-light text-base">{format(article.date)}</span>{' '}
|
<span className="font-light text-base">{format(article.date)}</span>{' '}
|
||||||
</div>
|
</div>
|
||||||
@@ -63,7 +63,7 @@ export function DesktopItem({dataset} : { dataset: Dataset}) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{dataset.articles.map((article, index) => (
|
{dataset.articles.map((article, index) => (
|
||||||
<tr className={`${index === (dataset.articles.length - 1) ? 'border-b' : ''} border-zinc-400`}>
|
<tr key={article.url} className={`${index === (dataset.articles.length - 1) ? 'border-b' : ''} border-zinc-400`}>
|
||||||
<td className="py-8 font-light">{index === 0 ? dataset.name : ''}</td>
|
<td className="py-8 font-light">{index === 0 ? dataset.name : ''}</td>
|
||||||
<td>
|
<td>
|
||||||
<a className="py-8 font-bold hover:underline" href={article.url}>
|
<a className="py-8 font-bold hover:underline" href={article.url}>
|
||||||
@@ -148,7 +148,7 @@ export default function Home( { datasets }: { datasets: Dataset[] }) {
|
|||||||
stories and visualizations of your own.
|
stories and visualizations of your own.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<article className="w-full px-2 md:hidden py-4">{datasets.map(dataset => <MobileItem dataset={dataset} />)}</article>
|
<article className="w-full px-2 md:hidden py-4">{datasets.map(dataset => <MobileItem key={dataset.name} dataset={dataset} />)}</article>
|
||||||
<table className="w-full mt-10 mb-4 hidden md:table">
|
<table className="w-full mt-10 mb-4 hidden md:table">
|
||||||
<thead className="border-b-4 pb-2 border-zinc-900">
|
<thead className="border-b-4 pb-2 border-zinc-900">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -163,7 +163,7 @@ export default function Home( { datasets }: { datasets: Dataset[] }) {
|
|||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>{datasets.map(dataset => <DesktopItem dataset={dataset} />)}</tbody>
|
<tbody>{datasets.map(dataset => <DesktopItem key={dataset.name} dataset={dataset} />)}</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p className="text-[13px] py-8">
|
<p className="text-[13px] py-8">
|
||||||
Unless otherwise noted, our data sets are available under the{' '}
|
Unless otherwise noted, our data sets are available under the{' '}
|
||||||
|
|||||||
Reference in New Issue
Block a user