Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,112 changes: 480 additions & 5,632 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"next": "10.0.6",
"react": "17.0.1",
"react-dom": "17.0.1"
"next": "^13.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
7 changes: 7 additions & 0 deletions pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function NotFoundPage() {
return <div>
<h1>Page not found!</h1>
</div>
};

export default NotFoundPage;
9 changes: 9 additions & 0 deletions pages/about/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function AboutPage() {
return (
<div>
<h1>The About Page</h1>
</div>
)
}

export default AboutPage;
15 changes: 15 additions & 0 deletions pages/blog/[...slug].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useRouter } from "next/router"

function BlogPostsPage() {

const router = useRouter();

console.log(router.query);

return <div>
<h1>The Blog Posts</h1>
</div>

}

export default BlogPostsPage;
14 changes: 14 additions & 0 deletions pages/clients/[id]/[clientprojectid].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useRouter } from "next/router";

function SelectedClientProjectPage() {

const router = useRouter();

console.log(router.query)

return <div>
<h1>The Project Page for a Specific Project for a Selected Client</h1>
</div>
}

export default SelectedClientProjectPage;
25 changes: 25 additions & 0 deletions pages/clients/[id]/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useRouter } from "next/router";

function ClientProjectsPage() {

const router = useRouter()

console.log(router.query)

function loadProjectHandler() {
// load data ...
router.push({
pathname: '/clients/[id]/[clientprojectid]',
query: {id: 'max', clientprojectid: 'projecta'},
})
}

return (
<div>
<h1>The Projects of a Given Client</h1>
<button onClick={loadProjectHandler}>Load Project A</button>
</div>
)
}

export default ClientProjectsPage;
27 changes: 27 additions & 0 deletions pages/clients/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Link from 'next/link';

function ClientsPage() {

const clients = [
{ id: "max", name: "Maximilian" },
{ id: "manu", name: "Manuel" },
{ id: "hung", name: "Hung" },
];


return <div>
<h1>The Clients Page</h1>
<ul>
{clients.map((client) => (
<li key={client.id}>
<Link href={{
pathname: 'clients/[id]',
query: {id: client.id}
}}>{client.name}</Link>
</li>
))}
</ul>
</div>
};

export default ClientsPage;
17 changes: 17 additions & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Link from 'next/link';

function HomePage() {
return <div>
<h1>The Home Page</h1>
<ul>
<li>
<Link href="/portfolio">Portfolio</Link>
</li>
<li>
<Link href="clients">Clients</Link>
</li>
</ul>
</div>
}

export default HomePage;
20 changes: 20 additions & 0 deletions pages/portfolio/[projectid].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { useRouter } from 'next/router';

function PortfolioProjectPage() {

const router = useRouter();

console.log(router.pathname);
console.log(router.query);

// send a request to some backend server
// to fetch the piece of data with an id of router.query.projectid

return (
<div>
<h1>The Portfolio Project Page</h1>
</div>
);
}

export default PortfolioProjectPage;
7 changes: 7 additions & 0 deletions pages/portfolio/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function PortfolioPage() {
return <div>
<h1>The Portfolio Page</h1>
</div>
}

export default PortfolioPage;
9 changes: 9 additions & 0 deletions pages/portfolio/list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function ListPage() {
return (
<div>
<h1>The List Page</h1>
</div>
)
}

export default ListPage;