- Read this page! + Read this page!
@@ -93,8 +93,15 @@ export default function Home() {
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
- font-family: Menlo, Monaco, Lucida Console, Liberation Mono,
- DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
+ font-family:
+ Menlo,
+ Monaco,
+ Lucida Console,
+ Liberation Mono,
+ DejaVu Sans Mono,
+ Bitstream Vera Sans Mono,
+ Courier New,
+ monospace;
}
`}
@@ -103,8 +110,17 @@ export default function Home() {
body {
padding: 0;
margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
- Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue,
+ font-family:
+ -apple-system,
+ BlinkMacSystemFont,
+ Segoe UI,
+ Roboto,
+ Oxygen,
+ Ubuntu,
+ Cantarell,
+ Fira Sans,
+ Droid Sans,
+ Helvetica Neue,
sans-serif;
}
* {
@@ -112,5 +128,5 @@ export default function Home() {
}
`}
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/basics/assets-metadata-css-starter/pages/posts/first-post.js b/basics/assets-metadata-css-starter/pages/posts/first-post.js
index 23cb95e..afd8c68 100644
--- a/basics/assets-metadata-css-starter/pages/posts/first-post.js
+++ b/basics/assets-metadata-css-starter/pages/posts/first-post.js
@@ -1,4 +1,4 @@
-import Link from 'next/link'
+import Link from 'next/link';
export default function FirstPost() {
return (
@@ -8,5 +8,5 @@ export default function FirstPost() {
Back to home
>
- )
+ );
}
diff --git a/basics/assets-metadata-css-starter/styles/Home.module.css b/basics/assets-metadata-css-starter/styles/Home.module.css
index b825756..cb4a976 100644
--- a/basics/assets-metadata-css-starter/styles/Home.module.css
+++ b/basics/assets-metadata-css-starter/styles/Home.module.css
@@ -33,7 +33,6 @@
text-align: center;
}
-
.description {
line-height: 1.5;
font-size: 1.5rem;
@@ -58,7 +57,9 @@
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
- transition: color 0.15s ease, border-color 0.15s ease;
+ transition:
+ color 0.15s ease,
+ border-color 0.15s ease;
}
.card:hover,
diff --git a/basics/assets-metadata-css-starter/styles/globals.css b/basics/assets-metadata-css-starter/styles/globals.css
index 95bfb35..fbf4c07 100644
--- a/basics/assets-metadata-css-starter/styles/globals.css
+++ b/basics/assets-metadata-css-starter/styles/globals.css
@@ -2,8 +2,19 @@ html,
body {
padding: 0;
margin: 0;
- font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
- Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
+ font-family:
+ Inter,
+ -apple-system,
+ BlinkMacSystemFont,
+ Segoe UI,
+ Roboto,
+ Oxygen,
+ Ubuntu,
+ Cantarell,
+ Fira Sans,
+ Droid Sans,
+ Helvetica Neue,
+ sans-serif;
}
a {
diff --git a/basics/basics-final/README.md b/basics/basics-final/README.md
index 02695bc..1a60afb 100644
--- a/basics/basics-final/README.md
+++ b/basics/basics-final/README.md
@@ -1 +1 @@
-This is a starter template for [Learn Next.js](https://nextjs.org/learn).
\ No newline at end of file
+This is a starter template for [Learn Next.js](https://nextjs.org/learn).
diff --git a/basics/basics-final/components/date.js b/basics/basics-final/components/date.js
index 0ec71d3..f9e5891 100644
--- a/basics/basics-final/components/date.js
+++ b/basics/basics-final/components/date.js
@@ -1,6 +1,6 @@
-import { parseISO, format } from 'date-fns'
+import { parseISO, format } from 'date-fns';
export default function Date({ dateString }) {
- const date = parseISO(dateString)
- return
+ const date = parseISO(dateString);
+ return ;
}
diff --git a/basics/basics-final/components/layout.js b/basics/basics-final/components/layout.js
index 5049dfc..821d043 100644
--- a/basics/basics-final/components/layout.js
+++ b/basics/basics-final/components/layout.js
@@ -1,13 +1,13 @@
-import Head from 'next/head'
-import Image from 'next/image'
-import Script from 'next/script'
+import Head from 'next/head';
+import Image from 'next/image';
+import Script from 'next/script';
-import styles from './layout.module.css'
-import utilStyles from '../styles/utils.module.css'
-import Link from 'next/link'
+import styles from './layout.module.css';
+import utilStyles from '../styles/utils.module.css';
+import Link from 'next/link';
-const name = '[Your Name]'
-export const siteTitle = 'Next.js Sample Website'
+const name = '[Your Name]';
+export const siteTitle = 'Next.js Sample Website';
export default function Layout({ children, home }) {
return (
@@ -21,7 +21,7 @@ export default function Layout({ children, home }) {
@@ -74,5 +74,5 @@ export default function Layout({ children, home }) {
)}
- )
+ );
}
diff --git a/basics/basics-final/lib/posts.js b/basics/basics-final/lib/posts.js
index be54bb2..f32c755 100644
--- a/basics/basics-final/lib/posts.js
+++ b/basics/basics-final/lib/posts.js
@@ -1,69 +1,69 @@
-import fs from 'fs'
-import path from 'path'
-import matter from 'gray-matter'
-import { remark } from 'remark'
-import html from 'remark-html'
+import fs from 'fs';
+import path from 'path';
+import matter from 'gray-matter';
+import { remark } from 'remark';
+import html from 'remark-html';
-const postsDirectory = path.join(process.cwd(), 'posts')
+const postsDirectory = path.join(process.cwd(), 'posts');
export function getSortedPostsData() {
// Get file names under /posts
- const fileNames = fs.readdirSync(postsDirectory)
- const allPostsData = fileNames.map(fileName => {
+ const fileNames = fs.readdirSync(postsDirectory);
+ const allPostsData = fileNames.map((fileName) => {
// Remove ".md" from file name to get id
- const id = fileName.replace(/\.md$/, '')
+ const id = fileName.replace(/\.md$/, '');
// Read markdown file as string
- const fullPath = path.join(postsDirectory, fileName)
- const fileContents = fs.readFileSync(fullPath, 'utf8')
+ const fullPath = path.join(postsDirectory, fileName);
+ const fileContents = fs.readFileSync(fullPath, 'utf8');
// Use gray-matter to parse the post metadata section
- const matterResult = matter(fileContents)
+ const matterResult = matter(fileContents);
// Combine the data with the id
return {
id,
- ...matterResult.data
- }
- })
+ ...matterResult.data,
+ };
+ });
// Sort posts by date
return allPostsData.sort((a, b) => {
if (a.date < b.date) {
- return 1
+ return 1;
} else {
- return -1
+ return -1;
}
- })
+ });
}
export function getAllPostIds() {
- const fileNames = fs.readdirSync(postsDirectory)
- return fileNames.map(fileName => {
+ const fileNames = fs.readdirSync(postsDirectory);
+ return fileNames.map((fileName) => {
return {
params: {
- id: fileName.replace(/\.md$/, '')
- }
- }
- })
+ id: fileName.replace(/\.md$/, ''),
+ },
+ };
+ });
}
export async function getPostData(id) {
- const fullPath = path.join(postsDirectory, `${id}.md`)
- const fileContents = fs.readFileSync(fullPath, 'utf8')
+ const fullPath = path.join(postsDirectory, `${id}.md`);
+ const fileContents = fs.readFileSync(fullPath, 'utf8');
// Use gray-matter to parse the post metadata section
- const matterResult = matter(fileContents)
+ const matterResult = matter(fileContents);
// Use remark to convert markdown into HTML string
const processedContent = await remark()
.use(html)
- .process(matterResult.content)
- const contentHtml = processedContent.toString()
+ .process(matterResult.content);
+ const contentHtml = processedContent.toString();
// Combine the data with the id and contentHtml
return {
id,
contentHtml,
- ...matterResult.data
- }
+ ...matterResult.data,
+ };
}
diff --git a/basics/basics-final/package.json b/basics/basics-final/package.json
index ac56f9f..4125396 100644
--- a/basics/basics-final/package.json
+++ b/basics/basics-final/package.json
@@ -1,11 +1,8 @@
{
"private": true,
- "engines": {
- "node": ">=18"
- },
"scripts": {
- "dev": "next dev",
"build": "next build",
+ "dev": "next dev",
"start": "next start"
},
"dependencies": {
@@ -16,5 +13,8 @@
"react-dom": "18.2.0",
"remark": "^14.0.2",
"remark-html": "^15.0.1"
+ },
+ "engines": {
+ "node": ">=18"
}
}
diff --git a/basics/basics-final/pages/_app.js b/basics/basics-final/pages/_app.js
index 7e66efc..b0ac743 100644
--- a/basics/basics-final/pages/_app.js
+++ b/basics/basics-final/pages/_app.js
@@ -1,5 +1,5 @@
-import '../styles/global.css'
+import '../styles/global.css';
export default function App({ Component, pageProps }) {
- return
{postData.date} - ) + ); } export async function getStaticPaths() { - const paths = getAllPostIds() + const paths = getAllPostIds(); return { paths, - fallback: false - } + fallback: false, + }; } export async function getStaticProps({ params }) { - const postData = getPostData(params.id) + const postData = getPostData(params.id); return { props: { - postData - } - } + postData, + }, + }; } diff --git a/basics/dynamic-routes-step-1/styles/global.css b/basics/dynamic-routes-step-1/styles/global.css index 9e1b0fb..c350934 100644 --- a/basics/dynamic-routes-step-1/styles/global.css +++ b/basics/dynamic-routes-step-1/styles/global.css @@ -2,8 +2,18 @@ html, body { padding: 0; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, + sans-serif; line-height: 1.6; font-size: 18px; } diff --git a/basics/learn-starter/README.md b/basics/learn-starter/README.md index 02695bc..1a60afb 100644 --- a/basics/learn-starter/README.md +++ b/basics/learn-starter/README.md @@ -1 +1 @@ -This is a starter template for [Learn Next.js](https://nextjs.org/learn). \ No newline at end of file +This is a starter template for [Learn Next.js](https://nextjs.org/learn). diff --git a/basics/learn-starter/package.json b/basics/learn-starter/package.json index ac9b5ce..d2e255f 100644 --- a/basics/learn-starter/package.json +++ b/basics/learn-starter/package.json @@ -1,16 +1,16 @@ { "private": true, - "engines": { - "node": ">=18" - }, "scripts": { - "dev": "next dev", "build": "next build", + "dev": "next dev", "start": "next start" }, "dependencies": { "next": "latest", "react": "18.2.0", "react-dom": "18.2.0" + }, + "engines": { + "node": ">=18" } } diff --git a/basics/learn-starter/pages/index.js b/basics/learn-starter/pages/index.js index 51c838e..a465e1d 100644 --- a/basics/learn-starter/pages/index.js +++ b/basics/learn-starter/pages/index.js @@ -92,8 +92,15 @@ export default function Home() { border-radius: 5px; padding: 0.75rem; font-size: 1.1rem; - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, - DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; + font-family: + Menlo, + Monaco, + Lucida Console, + Liberation Mono, + DejaVu Sans Mono, + Bitstream Vera Sans Mono, + Courier New, + monospace; } `} @@ -102,8 +109,17 @@ export default function Home() { body { padding: 0; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, sans-serif; } * { @@ -111,5 +127,5 @@ export default function Home() { } `} - ) + ); } diff --git a/basics/learn-starter/styles/Home.module.css b/basics/learn-starter/styles/Home.module.css index b825756..cb4a976 100644 --- a/basics/learn-starter/styles/Home.module.css +++ b/basics/learn-starter/styles/Home.module.css @@ -33,7 +33,6 @@ text-align: center; } - .description { line-height: 1.5; font-size: 1.5rem; @@ -58,7 +57,9 @@ text-decoration: none; border: 1px solid #eaeaea; border-radius: 10px; - transition: color 0.15s ease, border-color 0.15s ease; + transition: + color 0.15s ease, + border-color 0.15s ease; } .card:hover, diff --git a/basics/learn-starter/styles/globals.css b/basics/learn-starter/styles/globals.css index 95bfb35..fbf4c07 100644 --- a/basics/learn-starter/styles/globals.css +++ b/basics/learn-starter/styles/globals.css @@ -2,8 +2,19 @@ html, body { padding: 0; margin: 0; - font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, + sans-serif; } a { diff --git a/basics/navigate-between-pages-starter/README.md b/basics/navigate-between-pages-starter/README.md index 02695bc..1a60afb 100644 --- a/basics/navigate-between-pages-starter/README.md +++ b/basics/navigate-between-pages-starter/README.md @@ -1 +1 @@ -This is a starter template for [Learn Next.js](https://nextjs.org/learn). \ No newline at end of file +This is a starter template for [Learn Next.js](https://nextjs.org/learn). diff --git a/basics/navigate-between-pages-starter/package.json b/basics/navigate-between-pages-starter/package.json index ac9b5ce..d2e255f 100644 --- a/basics/navigate-between-pages-starter/package.json +++ b/basics/navigate-between-pages-starter/package.json @@ -1,16 +1,16 @@ { "private": true, - "engines": { - "node": ">=18" - }, "scripts": { - "dev": "next dev", "build": "next build", + "dev": "next dev", "start": "next start" }, "dependencies": { "next": "latest", "react": "18.2.0", "react-dom": "18.2.0" + }, + "engines": { + "node": ">=18" } } diff --git a/basics/navigate-between-pages-starter/pages/index.js b/basics/navigate-between-pages-starter/pages/index.js index 0647b88..5a4ea36 100644 --- a/basics/navigate-between-pages-starter/pages/index.js +++ b/basics/navigate-between-pages-starter/pages/index.js @@ -1,4 +1,4 @@ -import Head from 'next/head' +import Head from 'next/head'; import styles from '../styles/Home.module.css'; export default function Home() { @@ -92,8 +92,15 @@ export default function Home() { border-radius: 5px; padding: 0.75rem; font-size: 1.1rem; - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, - DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; + font-family: + Menlo, + Monaco, + Lucida Console, + Liberation Mono, + DejaVu Sans Mono, + Bitstream Vera Sans Mono, + Courier New, + monospace; } `} @@ -102,8 +109,17 @@ export default function Home() { body { padding: 0; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, sans-serif; } * { @@ -111,5 +127,5 @@ export default function Home() { } `} - ) + ); } diff --git a/basics/navigate-between-pages-starter/styles/Home.module.css b/basics/navigate-between-pages-starter/styles/Home.module.css index b825756..cb4a976 100644 --- a/basics/navigate-between-pages-starter/styles/Home.module.css +++ b/basics/navigate-between-pages-starter/styles/Home.module.css @@ -33,7 +33,6 @@ text-align: center; } - .description { line-height: 1.5; font-size: 1.5rem; @@ -58,7 +57,9 @@ text-decoration: none; border: 1px solid #eaeaea; border-radius: 10px; - transition: color 0.15s ease, border-color 0.15s ease; + transition: + color 0.15s ease, + border-color 0.15s ease; } .card:hover, diff --git a/basics/navigate-between-pages-starter/styles/globals.css b/basics/navigate-between-pages-starter/styles/globals.css index 95bfb35..fbf4c07 100644 --- a/basics/navigate-between-pages-starter/styles/globals.css +++ b/basics/navigate-between-pages-starter/styles/globals.css @@ -2,8 +2,19 @@ html, body { padding: 0; margin: 0; - font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, - Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, + sans-serif; } a { diff --git a/basics/snippets/link-classname-example.js b/basics/snippets/link-classname-example.js index 3f2e979..460fa8b 100644 --- a/basics/snippets/link-classname-example.js +++ b/basics/snippets/link-classname-example.js @@ -1,12 +1,12 @@ // Example: Adding className with -import Link from 'next/link' +import Link from 'next/link'; export default function LinkClassnameExample() { return ( Hello World - ) + ); } // Take a look at https://nextjs.org/docs/api-reference/next/link diff --git a/basics/typescript-final/README.md b/basics/typescript-final/README.md index 02695bc..1a60afb 100644 --- a/basics/typescript-final/README.md +++ b/basics/typescript-final/README.md @@ -1 +1 @@ -This is a starter template for [Learn Next.js](https://nextjs.org/learn). \ No newline at end of file +This is a starter template for [Learn Next.js](https://nextjs.org/learn). diff --git a/basics/typescript-final/components/date.tsx b/basics/typescript-final/components/date.tsx index 70662ea..d783749 100644 --- a/basics/typescript-final/components/date.tsx +++ b/basics/typescript-final/components/date.tsx @@ -1,6 +1,6 @@ -import { parseISO, format } from 'date-fns' +import { parseISO, format } from 'date-fns'; export default function Date({ dateString }: { dateString: string }) { - const date = parseISO(dateString) - return + const date = parseISO(dateString); + return ; } diff --git a/basics/typescript-final/components/layout.tsx b/basics/typescript-final/components/layout.tsx index dcaec0f..a502745 100644 --- a/basics/typescript-final/components/layout.tsx +++ b/basics/typescript-final/components/layout.tsx @@ -1,18 +1,18 @@ -import Head from 'next/head' -import Image from 'next/image' -import styles from './layout.module.css' -import utilStyles from '../styles/utils.module.css' -import Link from 'next/link' +import Head from 'next/head'; +import Image from 'next/image'; +import styles from './layout.module.css'; +import utilStyles from '../styles/utils.module.css'; +import Link from 'next/link'; -const name = '[Your Name]' -export const siteTitle = 'Next.js Sample Website' +const name = '[Your Name]'; +export const siteTitle = 'Next.js Sample Website'; export default function Layout({ children, - home + home, }: { - children: React.ReactNode - home?: boolean + children: React.ReactNode; + home?: boolean; }) { return (
- +{" "} - {(invoice.amount / 100).toLocaleString("en-US", { - style: "currency", - currency: "USD", + +{' '} + {(invoice.amount / 100).toLocaleString('en-US', { + style: 'currency', + currency: 'USD', })}
diff --git a/dashboard/15-final/app/ui/dashboard/overview.tsx b/dashboard/15-final/app/ui/dashboard/overview.tsx index 173005b..f3c011e 100644 --- a/dashboard/15-final/app/ui/dashboard/overview.tsx +++ b/dashboard/15-final/app/ui/dashboard/overview.tsx @@ -1,12 +1,12 @@ -import Card from "@/app/ui/dashboard/card"; -import { invoices, customers, revenue } from "@/app/lib/dummy-data"; -import { calculateAllInvoices } from "@/app/lib/calculations"; -import RevenueChart from "@/app/ui/dashboard/revenue-chart"; -import LatestInvoices from "@/app/ui/dashboard/latest-invoices"; +import Card from '@/app/ui/dashboard/card'; +import { invoices, customers, revenue } from '@/app/lib/dummy-data'; +import { calculateAllInvoices } from '@/app/lib/calculations'; +import RevenueChart from '@/app/ui/dashboard/revenue-chart'; +import LatestInvoices from '@/app/ui/dashboard/latest-invoices'; export default function DashboardOverview() { - const totalPaidInvoices = calculateAllInvoices(invoices, "paid"); - const totalPendingInvoices = calculateAllInvoices(invoices, "pending"); + const totalPaidInvoices = calculateAllInvoices(invoices, 'paid'); + const totalPendingInvoices = calculateAllInvoices(invoices, 'pending'); const numberOfInvoices = invoices.length; const numberOfCustomers = customers.length; diff --git a/dashboard/15-final/app/ui/dashboard/revenue-chart.tsx b/dashboard/15-final/app/ui/dashboard/revenue-chart.tsx index 289c3d5..781d200 100644 --- a/dashboard/15-final/app/ui/dashboard/revenue-chart.tsx +++ b/dashboard/15-final/app/ui/dashboard/revenue-chart.tsx @@ -1,5 +1,5 @@ -import { Revenue } from "@/app/lib/definitions"; -import { generateYAxis } from "@/app/lib/calculations"; +import { Revenue } from '@/app/lib/definitions'; +import { generateYAxis } from '@/app/lib/calculations'; // This component is representational only. // For data visualization UI, check out: @@ -17,7 +17,7 @@ export default function RevenueChart({ revenue }: { revenue: Revenue[] }) { return (