-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f44855a
commit 6e87b75
Showing
27 changed files
with
415 additions
and
337 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use client'; | ||
|
||
export default function GlobalError({ | ||
error, | ||
reset, | ||
}: { | ||
error: Error; | ||
reset: () => void; | ||
}) { | ||
return ( | ||
<html> | ||
<body> | ||
<h2>Something went wrong!</h2> | ||
<button onClick={() => reset()}>Try again</button> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import '@/styles/globals.css'; | ||
import { Metadata } from 'next'; | ||
import { M_PLUS_1p } from 'next/font/google'; | ||
import ContextProviders from '@/contexts/ContextProviders'; | ||
import ApiClient from '@/utils/ApiClient'; | ||
import { Header } from '@/components/Header'; | ||
import { Footer } from '@/components/Footer'; | ||
|
||
const mPlus1pFont = M_PLUS_1p({ | ||
subsets: ['latin-ext'], | ||
weight: ['400', '700'], | ||
}); | ||
|
||
export const metadata: Metadata = { | ||
title: 'For', | ||
description: | ||
'Webアプリケーション開発における備忘録や実装メモなどを発信しています。', | ||
}; | ||
|
||
type Props = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
export default async function RootLayout({ children }: Props) { | ||
const { contents } = await ApiClient.categories(); | ||
return ( | ||
<html lang="jp"> | ||
<head> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/@coreui/icons/css/all.min.css" | ||
/> | ||
<link rel="shortcut icon" href="/favicon.ico" /> | ||
<script | ||
defer | ||
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID}`} | ||
/> | ||
<script | ||
id={'ga'} | ||
defer | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID}');`, | ||
}} | ||
/> | ||
</head> | ||
<body className={mPlus1pFont.className}> | ||
<ContextProviders> | ||
<Header categories={contents} /> | ||
{children} | ||
<Footer categories={contents} /> | ||
</ContextProviders> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function NotFound() { | ||
return <h1 className="text-24">Not found.</h1>; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { ArticleCard } from '@/components/Card/ArticleCard'; | ||
import ApiClient from '@/utils/ApiClient'; | ||
|
||
export default async function Page() { | ||
const { contents } = await ApiClient.articles(); | ||
return ( | ||
<> | ||
<main className="bg-gray-800 pt-76 pb-20 md:pt-180 md:pb-80"> | ||
<div className="mx-auto max-w-lg px-15 md:px-30"> | ||
<ul className="md:flex md:flex-wrap md:justify-between"> | ||
{contents?.map((article, index) => ( | ||
<li | ||
key={article.id} | ||
className={ | ||
index == 0 | ||
? 'md:w-100p' | ||
: 'mt-15 md:mt-30 md:w-[calc(50%-15px)]' | ||
} | ||
> | ||
<ArticleCard | ||
unevenness="bumps" | ||
shadowColor="default" | ||
data={{ | ||
title: article.title, | ||
date: article.publishedAt, | ||
href: `/articles/${article.id}`, | ||
categories: article.categories.map( | ||
(category) => category.name | ||
), | ||
}} | ||
/> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</main> | ||
</> | ||
); | ||
} |
This file contains 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
Oops, something went wrong.