Skip to content

Commit

Permalink
Complete initial features
Browse files Browse the repository at this point in the history
  • Loading branch information
iasandcb committed Oct 22, 2024
1 parent 29aed89 commit 8bc2ef9
Show file tree
Hide file tree
Showing 47 changed files with 1,688 additions and 810 deletions.
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
# Codeitmall based on Next app router
45 changes: 16 additions & 29 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
:root {
--background: #ffffff;
--foreground: #171717;
* {
box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
body {
font-size: 16px;
}

html,
body {
max-width: 100vw;
overflow-x: hidden;
body.dark {
background-color: #121212;
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
body.dark,
body.dark a {
color: #f9f9f9;
}

* {
box-sizing: border-box;
padding: 0;
margin: 0;
body.light {
background-color: #ededed;
}

a {
color: inherit;
text-decoration: none;
body.light,
body.light a {
color: #121212;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
.container {
padding: 80px 0;
}
12 changes: 10 additions & 2 deletions app/layout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import localFont from "next/font/local";
import "./globals.css";
import Header from "@/components/Header";
import Container from "@/components/Container";
import { ThemeProvider } from "@/lib/ThemeContext";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
Expand All @@ -13,15 +16,20 @@ const geistMono = localFont({
});

export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Codeitmall",
description: "Based on Next 15",
};

export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
<ThemeProvider>
<Header />
<Container>
{children}
</Container>
</ThemeProvider>
</body>
</html>
);
Expand Down
99 changes: 9 additions & 90 deletions app/page.js
Original file line number Diff line number Diff line change
@@ -1,95 +1,14 @@
import Image from "next/image";
import styles from "./page.module.css";
import ProductList from "@/components/ProductList";
import axios from '@/lib/axios';

export default function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<Image
className={styles.logo}
src="https://nextjs.org/icons/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol>
<li>
Get started by editing <code>app/page.js</code>.
</li>
<li>Save and see your changes instantly.</li>
</ol>
export default async function Home() {
const res = await axios.get('/products');
const products = res.data.results;

<div className={styles.ctas}>
<a
className={styles.primary}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className={styles.logo}
src="https://nextjs.org/icons/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
className={styles.secondary}
>
Read our docs
</a>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
</div>
return (
<>
<ProductList className={styles.productList} products={products}/>
</>
);
}
Loading

0 comments on commit 8bc2ef9

Please sign in to comment.