-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add app routed pages while preserving existing routes. re #64
- Loading branch information
Showing
6 changed files
with
172 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import '../styles/global.css'; | ||
|
||
import type { Metadata } from 'next'; | ||
|
||
export const metadata: Metadata = { | ||
icons: [ | ||
{ | ||
rel: 'apple-touch-icon', | ||
url: '/apple-touch-icon.png', | ||
}, | ||
{ | ||
rel: 'icon', | ||
type: 'image/png', | ||
sizes: '32x32', | ||
url: '/favicon-32x32.png', | ||
}, | ||
{ | ||
rel: 'icon', | ||
type: 'image/png', | ||
sizes: '16x16', | ||
url: '/favicon-16x16.png', | ||
}, | ||
{ | ||
rel: 'icon', | ||
url: '/favicon.ico', | ||
}, | ||
], | ||
}; | ||
|
||
export default function RootLayout({ | ||
// Layouts must accept a children prop. | ||
// This will be populated with nested layouts or pages | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</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,33 @@ | ||
import type { Metadata } from 'next'; | ||
import Link from 'next/link'; | ||
|
||
import { Main } from '@/templates/Main'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'New Router', | ||
description: | ||
'Incrementally migrate your existing application from pages to app', | ||
}; | ||
|
||
const NewRouter = () => ( | ||
<Main> | ||
<p> | ||
Moving to the App Router may be the first time using React features that | ||
Next.js builds on top of such as Server Components, Suspense, and more. | ||
When combined with new Next.js features such as special files and layouts, | ||
migration means new concepts, mental models, and behavioral changes to | ||
learn. | ||
</p> | ||
<p> | ||
We recommend reducing the combined complexity of these updates by breaking | ||
down your migration into smaller steps. The app directory is intentionally | ||
designed to work simultaneously with the pages directory to allow for | ||
incremental page-by-page migration.{' '} | ||
<Link href="https://nextjs.org/docs/pages/building-your-application/upgrading/app-router-migration#migrating-from-pages-to-app"> | ||
Learn more. | ||
</Link> | ||
</p> | ||
</Main> | ||
); | ||
|
||
export default NewRouter; |
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,31 @@ | ||
import type { Metadata } from 'next'; | ||
|
||
import { Main } from '@/templates/Main'; | ||
|
||
type Props = { | ||
params: { slug: string }; | ||
}; | ||
|
||
export async function generateMetadata({ params }: Props): Promise<Metadata> { | ||
const { slug } = params; | ||
|
||
return { | ||
title: `Porfolio ${slug}`, | ||
}; | ||
} | ||
|
||
const PortfolioDetail = ({ params }: Props) => ( | ||
<Main> | ||
<h1 className="capitalize">Porfolio {params.slug}</h1> | ||
<p> | ||
Designed a series of promotional materials and branding assets for a | ||
corporate event. Developed a visually cohesive theme, including a logo, | ||
posters, banners, and digital assets. Incorporated the client's brand | ||
identity while adding a fresh and modern touch. Received positive feedback | ||
from event attendees and contributed to a successful event with increased | ||
attendee participation and brand recognition. | ||
</p> | ||
</Main> | ||
); | ||
|
||
export default PortfolioDetail; |
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,47 @@ | ||
import type { Metadata } from 'next'; | ||
import Link from 'next/link'; | ||
|
||
import { Main } from '@/templates/Main'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'Portfolio', | ||
description: 'Welcome to my portfolio page!', | ||
}; | ||
|
||
const Portfolio = () => ( | ||
<Main> | ||
<p> | ||
Welcome to my portfolio page! Here you will find a carefully curated | ||
collection of my work and accomplishments. Through this portfolio, I aim | ||
to showcase my expertise, creativity, and the value I can bring to your | ||
projects. | ||
</p> | ||
|
||
<div className="container mx-auto mt-20 grid grid-cols-1 gap-8 md:grid-cols-2 xl:grid-cols-3"> | ||
{Array.from(Array(6).keys()).map((idx) => ( | ||
<div key={idx}> | ||
<div className="overflow-hidden rounded-lg"> | ||
<div className="relative overflow-hidden pb-60"> | ||
<Link href={`/portfolio/${idx}`}> | ||
<img | ||
className="absolute h-full w-full object-cover object-center" | ||
src="/assets/images/nextjs-starter-banner.png" | ||
alt="" | ||
/> | ||
</Link> | ||
</div> | ||
<div className="relative bg-blue-200"> | ||
<div className="p-3"> | ||
<Link href={`/portfolio/${idx}`}> | ||
<h3 className="text-1xl font-bold">Portfolio {idx}</h3> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</Main> | ||
); | ||
|
||
export default Portfolio; |
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