Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiDaniel committed Sep 24, 2024
0 parents commit c4d9d9e
Show file tree
Hide file tree
Showing 75 changed files with 21,138 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem
.prettierignore

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel
.editorconfig

# typescript
*.tsbuildinfo
next-env.d.ts
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/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 `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## 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/deployment) for more details.
39 changes: 39 additions & 0 deletions app/components/CheckoutButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { useState } from "react";

const CheckoutButton = () => {
const [loading, setLoading] = useState(false);

const handleCheckout = async () => {
setLoading(true);
try {
const response = await fetch("/api/checkout", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
// Your cart details and other necessary data
}),
});

const data = await response.json();
if (data.url) {
window.location.href = data.url; // Redirect to Stripe checkout
} else {
console.error("Checkout session creation failed");
}
} catch (error) {
console.error("Error during checkout:", error);
} finally {
setLoading(false);
}
};

return (
<button onClick={handleCheckout} disabled={loading}>
{loading ? "Loading..." : "Checkout"}
</button>
);
};

export default CheckoutButton;
39 changes: 39 additions & 0 deletions app/components/Icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
LucideProps,
Moon,
SunMedium,
type Icon as LucideIcon,
} from "lucide-react";

//export type Icon = typeof LucideIcon

export const Icons = {
sun: SunMedium,
moon: Moon,
logo: (props: LucideProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
data-name="Layer 1"
viewBox="0 0 500 500"
{...props}
>
<rect
width={500}
height={500}
rx={7.69}
ry={7.69}
style={{
strokeWidth: 0,
fill: "#233e97",
}}
/>
<path
d="M246.03 451.29c-47.12 0-86.16-23.86-104.45-63.83-11.96-26.14-30.78-97.35 52.54-193.75l2.03 1.75-2.03-1.75c24.16-27.95 54.24-54.95 72.81-59.6 2.24-11 2.07-19.51-.56-25.18-1.76-3.78-4.58-6.28-8.62-7.63-19.79-6.58-45.92 13.22-99.86 75.76-14.09 16.33-24.02 22.41-30.35 18.56-7.58-4.59-5.57-21-1.64-35.5-2.29-.87-4.27-2.32-5.83-4.3-4.39-5.57-7.41-17.72 3.08-43.95 14.06-35.15 41.57-50.47 62.17-57.14 23.63-7.64 51.14-8.05 73.6-1.1 49.48 15.32 79 59.14 78.95 117.22-.01 17.87-3.24 35.94-9.33 52.25 33.07 19.14 55.43 55.28 55.43 96.61 0 79.92-54.14 131.56-137.94 131.56Zm19.52-311.2c-14.19 5.15-39.42 24.8-67.37 57.14-57.23 66.22-76.08 134.75-51.72 188.01 17.39 38.01 54.61 60.7 99.57 60.7 39.86 0 73.33-11.8 96.77-34.12 23.42-22.3 35.8-54.14 35.8-92.07s-20.96-73.26-52.06-91.57c-13.57 32.33-38.82 56.62-72.96 56.62s-50.77-17.67-50.77-34.08c0-10.87 6.64-21.46 18.2-29.04 13.01-8.53 31.52-13.04 53.5-13.04 17.64 0 34.32 4.26 49.09 11.82 5.99-16.49 8.88-34.11 8.89-49.58.04-55.61-28.06-97.51-75.18-112.1-21.45-6.64-47.76-6.24-70.36 1.08-19.51 6.31-45.56 20.8-58.84 54.02-10.42 26.05-6.16 35.7-3.85 38.64a8.086 8.086 0 0 0 3.12 2.44c1.25-4.02 2.58-7.75 3.8-10.83 11.3-28.47 24.35-47.04 34.06-48.46 2.56-.37 4.79.48 6.32 2.41 3.75 4.75 2.63 15.37-3.17 29.9-6.97 17.5-20.99 31.04-34.07 32.94-1.1.16-2.17.2-3.21.21-4.37 15.91-4.34 27.8-.81 29.94.92.56 6.4 2.36 23.51-17.48 56.37-65.35 83-84.87 105.61-77.34 5.44 1.81 9.41 5.33 11.79 10.45 2.98 6.4 3.41 15.35 1.3 26.74 2.09.05 3.95.54 5.54 1.51 8.2 4.97 7.26 19.83-2.89 45.41-4.28 10.79-9.73 17.41-14.96 18.18-2.31.35-4.4-.5-5.87-2.36-4.12-5.21-2.75-17.57 3.75-33.91 3.22-8.1 5.7-15.51 7.43-22.16Zm8.97 73.89c-26.46 0-42.1 6.62-50.56 12.17-10.03 6.58-15.78 15.53-15.78 24.56 0 13.83 14.21 28.72 45.41 28.72 33.81 0 56.08-24.55 68.09-53.95-14.17-7.35-30.19-11.49-47.16-11.49Zm-3.11-75.25c-1.79 7.56-4.56 16.07-8.31 25.5-7.19 18.06-6.1 26.61-4.53 28.6.31.39.52.44.88.38 1.79-.26 6.33-3.7 10.75-14.85 12.1-30.52 7.59-37.34 5.09-38.85-.99-.6-2.29-.84-3.88-.78Zm-105-37.8c-.11 0-.23.01-.37.03-5.09.74-17.25 13.38-29.85 45.13a154.76 154.76 0 0 0-3.45 9.6c.29-.03.56-.06.83-.1 9.52-1.38 22.84-12 29.86-29.62 6.18-15.51 5.38-22.75 3.94-24.59-.19-.24-.42-.46-.96-.46Z"
style={{
fill: "#eaeaea",
strokeWidth: 0,
}}
/>
</svg>
),
};
Loading

0 comments on commit c4d9d9e

Please sign in to comment.