diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..2523093 Binary files /dev/null and b/.DS_Store differ diff --git a/Websites/.DS_Store b/Websites/.DS_Store new file mode 100644 index 0000000..f398b6e Binary files /dev/null and b/Websites/.DS_Store differ diff --git a/Websites/UnusedPages/.DS_Store b/Websites/UnusedPages/.DS_Store new file mode 100644 index 0000000..9768a19 Binary files /dev/null and b/Websites/UnusedPages/.DS_Store differ diff --git a/Websites/UnusedPages/AddToCart.tsx b/Websites/UnusedPages/AddToCart.tsx index 4331614..1efc4f6 100644 --- a/Websites/UnusedPages/AddToCart.tsx +++ b/Websites/UnusedPages/AddToCart.tsx @@ -1,5 +1,5 @@ "use client"; -import React from 'react' +// import React from 'react' const AddToCart = () => { return ( diff --git a/Websites/UnusedPages/ProductCard/ProductCard.tsx b/Websites/UnusedPages/ProductCard/ProductCard.tsx index f489d32..5fa544d 100644 --- a/Websites/UnusedPages/ProductCard/ProductCard.tsx +++ b/Websites/UnusedPages/ProductCard/ProductCard.tsx @@ -1,21 +1,21 @@ -import React from 'react'; -import AddToCart from '../AddToCart'; -// import styles from './ProductCard.module.css'; +// import React from 'react'; +// import AddToCart from '../AddToCart'; +// // import styles from './ProductCard.module.css'; -const ProductCard = () => { - return ( - //
style using css file +// const ProductCard = () => { +// return ( +// //
style using css file - // style using tailwind - //
- // - //
+// // style using tailwind +// //
+// // +// //
- // style using daisyUi component instead -
- -
- ) -} +// // style using daisyUi component instead +//
+// +//
+// ) +// } -export default ProductCard \ No newline at end of file +// export default ProductCard \ No newline at end of file diff --git a/Websites/UnusedPages/api/.DS_Store b/Websites/UnusedPages/api/.DS_Store new file mode 100644 index 0000000..076fb1a Binary files /dev/null and b/Websites/UnusedPages/api/.DS_Store differ diff --git a/Websites/UnusedPages/api/issues/route.ts b/Websites/UnusedPages/api/issues/route.ts new file mode 100644 index 0000000..9783bcc --- /dev/null +++ b/Websites/UnusedPages/api/issues/route.ts @@ -0,0 +1,27 @@ +// import { NextRequest, NextResponse } from "next/server"; +// import { z } from 'zod'; +// import prisma from "@/prisma/client"; + +// // validate the request with zod +// const createIssueSchema = z.object({ +// title: z.string().min(1).max(255), // confirms string is between 1-255 characters +// description: z.string().min(1), // confirms string has min length of 1 +// }); + +// // send request +// export async function POST(request: NextRequest) { +// // return request with a promise +// const body = await request.json(); + +// // validate the data +// const validation = createIssueSchema.safeParse(body); +// if (!validation.success) +// return NextResponse.json(validation.error.errors, {status: 400}) // Send error 400 if data is invalid + +// const newIssue = await prisma.issue.create({ +// data: { title: body.title, description: body.description } +// }); + +// // return the issue to the client +// return NextResponse.json(newIssue, {status: 201}); // status 201 means an object was created +// } \ No newline at end of file diff --git a/Websites/UnusedPages/issues/new/page.tsx b/Websites/UnusedPages/issues/new/page.tsx index f98d5f0..5d689f2 100644 --- a/Websites/UnusedPages/issues/new/page.tsx +++ b/Websites/UnusedPages/issues/new/page.tsx @@ -1,58 +1,58 @@ -"use client"; -import React from "react"; -import SimpleMDE from "react-simplemde-editor"; -import "easymde/dist/easymde.min.css"; -import { useForm, Controller } from "react-hook-form"; -import { FormEvent } from "react"; +// "use client"; +// import React from "react"; +// import SimpleMDE from "react-simplemde-editor"; +// import "easymde/dist/easymde.min.css"; +// import { useForm, Controller } from "react-hook-form"; +// import { FormEvent } from "react"; -interface IssueForm { - title: string; - description: string; -} +// interface IssueForm { +// title: string; +// description: string; +// } -const NewIssuePage = () => { - const { register, control, handleSubmit } = useForm(); - // console.log(register('title')) +// const NewIssuePage = () => { +// const { register, control, handleSubmit } = useForm(); +// // console.log(register('title')) - // handle form submit - async function onSubmit(event: FormEvent) { - event.preventDefault(); +// // handle form submit +// async function onSubmit(event: FormEvent) { +// event.preventDefault(); - const formData = new FormData(event.currentTarget); - const response = await fetch("/api/issues", { - method: "POST", - body: formData, - }); +// const formData = new FormData(event.currentTarget); +// const response = await fetch("/api/issues", { +// method: "POST", +// body: formData, +// }); - // Handle response if necessary - // const data = await response.json(); - // ... - } +// // Handle response if necessary +// // const data = await response.json(); +// // ... +// } - return ( -
console.log(data))} - onSubmit={onSubmit} - > - - ( - - )} - /> - - - ); -}; +// return ( +//
console.log(data))} +// onSubmit={onSubmit} +// > +// +// ( +// +// )} +// /> +// +// +// ); +// }; -export default NewIssuePage; +// export default NewIssuePage; diff --git a/Websites/UnusedPages/issues/page.tsx b/Websites/UnusedPages/issues/page.tsx index b8a9d23..092730e 100644 --- a/Websites/UnusedPages/issues/page.tsx +++ b/Websites/UnusedPages/issues/page.tsx @@ -1,22 +1,22 @@ -import Link from 'next/link' -import React from 'react' -import type { NextApiRequest, NextApiResponse } from 'next' +// import Link from 'next/link' +// import React from 'react' +// import type { NextApiRequest, NextApiResponse } from 'next' -const IssuesPage = () => { - async function handler( - req: NextApiRequest, - res: NextApiResponse, - ) { - const data = req.body - console.log(...data) - res.redirect(307, '/issues') - } +// const IssuesPage = () => { +// async function handler( +// req: NextApiRequest, +// res: NextApiResponse, +// ) { +// const data = req.body +// console.log(...data) +// res.redirect(307, '/issues') +// } - return ( -
- -
- ) -} +// return ( +//
+// +//
+// ) +// } -export default IssuesPage \ No newline at end of file +// export default IssuesPage \ No newline at end of file diff --git a/Websites/UnusedPages/prisma/client.ts b/Websites/UnusedPages/prisma/client.ts new file mode 100644 index 0000000..672810a --- /dev/null +++ b/Websites/UnusedPages/prisma/client.ts @@ -0,0 +1,19 @@ +// import { PrismaClient } from '@prisma/client' + +// // ensures there is only one instance of prisma at any given moment + +// const prismaClientSingleton = () => { +// return new PrismaClient() +// } + +// type PrismaClientSingleton = ReturnType + +// const globalForPrisma = globalThis as unknown as { +// prisma: PrismaClientSingleton | undefined +// } + +// const prisma = globalForPrisma.prisma ?? prismaClientSingleton() + +// export default prisma + +// if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma \ No newline at end of file diff --git a/Websites/jefes-nextjs/prisma/migrations/20231021063954_create_issue/migration.sql b/Websites/UnusedPages/prisma/migrations/20231021063954_create_issue/migration.sql similarity index 100% rename from Websites/jefes-nextjs/prisma/migrations/20231021063954_create_issue/migration.sql rename to Websites/UnusedPages/prisma/migrations/20231021063954_create_issue/migration.sql diff --git a/Websites/jefes-nextjs/prisma/migrations/migration_lock.toml b/Websites/UnusedPages/prisma/migrations/migration_lock.toml similarity index 100% rename from Websites/jefes-nextjs/prisma/migrations/migration_lock.toml rename to Websites/UnusedPages/prisma/migrations/migration_lock.toml diff --git a/Websites/jefes-nextjs/prisma/schema.prisma b/Websites/UnusedPages/prisma/schema.prisma similarity index 100% rename from Websites/jefes-nextjs/prisma/schema.prisma rename to Websites/UnusedPages/prisma/schema.prisma diff --git a/Websites/UnusedPages/prisma/scripts.txt b/Websites/UnusedPages/prisma/scripts.txt new file mode 100644 index 0000000..2a6c2ec --- /dev/null +++ b/Websites/UnusedPages/prisma/scripts.txt @@ -0,0 +1,3 @@ +"prisma": { + "seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts" + } \ No newline at end of file diff --git a/Websites/jefes-nextjs/prisma/seed.ts b/Websites/UnusedPages/prisma/seed.ts similarity index 100% rename from Websites/jefes-nextjs/prisma/seed.ts rename to Websites/UnusedPages/prisma/seed.ts diff --git a/Websites/UnusedPages/users/nested/page.tsx b/Websites/UnusedPages/users/nested/page.tsx index 91b9bc9..ceba6f6 100644 --- a/Websites/UnusedPages/users/nested/page.tsx +++ b/Websites/UnusedPages/users/nested/page.tsx @@ -1,9 +1,9 @@ -import React from 'react' +// import React from 'react' -const Nested = () => { - return ( -
Nested
- ) -} +// const Nested = () => { +// return ( +//
Nested
+// ) +// } -export default Nested \ No newline at end of file +// export default Nested \ No newline at end of file diff --git a/Websites/UnusedPages/users/page.tsx b/Websites/UnusedPages/users/page.tsx index 821617c..c57d0ac 100644 --- a/Websites/UnusedPages/users/page.tsx +++ b/Websites/UnusedPages/users/page.tsx @@ -1,51 +1,51 @@ -import { userInfo } from 'os'; -import React, { useState, useEffect } from 'react' +// import { userInfo } from 'os'; +// import React, { useState, useEffect } from 'react' -interface User { - id: number; - name: string; - email: string; -} +// interface User { +// id: number; +// name: string; +// email: string; +// } -const UsersPage = async () => { - // Get the json file - const res = await fetch( - 'https://jsonplaceholder.typicode.com/users', - // Option to disable caching entirely, useful for data that changes frequently. - {cache: 'no-store'} +// const UsersPage = async () => { +// // Get the json file +// const res = await fetch( +// 'https://jsonplaceholder.typicode.com/users', +// // Option to disable caching entirely, useful for data that changes frequently. +// {cache: 'no-store'} - // Option to store the data within the cache for a certain period of time - // { next: { revalidate: 10 }} // get fresh data every 10 seconds - ); - // Create an object that will hold the users within the json file - const users: User[] = await res.json(); - // Create a cache in order to hold the data for later(useful for tokens) +// // Option to store the data within the cache for a certain period of time +// // { next: { revalidate: 10 }} // get fresh data every 10 seconds +// ); +// // Create an object that will hold the users within the json file +// const users: User[] = await res.json(); +// // Create a cache in order to hold the data for later(useful for tokens) - return ( - <> -

Users

- {/*

{new Date().toLocaleTimeString()}

*/} - {/* instead of an unordered list, we'll use a table -
    - {users.map(user =>
  • {user.name}
  • )} -
*/} - - - - - - - - - {users.map(user=> - - - )} - -
NameEmail
{user.name}{user.email}
- - ) -} +// return ( +// <> +//

Users

+// {/*

{new Date().toLocaleTimeString()}

*/} +// {/* instead of an unordered list, we'll use a table +//
    +// {users.map(user =>
  • {user.name}
  • )} +//
*/} +// +// +// +// +// +// +// +// +// {users.map(user=> +// +// +// )} +// +//
NameEmail
{user.name}{user.email}
+// +// ) +// } -export default UsersPage \ No newline at end of file +// export default UsersPage \ No newline at end of file diff --git a/Websites/jefes-nextjs/app/api/issues/route.ts b/Websites/jefes-nextjs/app/api/issues/route.ts deleted file mode 100644 index c0924ef..0000000 --- a/Websites/jefes-nextjs/app/api/issues/route.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { NextRequest, NextResponse } from "next/server"; -import { z } from 'zod'; -import prisma from "@/prisma/client"; - -// validate the request with zod -const createIssueSchema = z.object({ - title: z.string().min(1).max(255), // confirms string is between 1-255 characters - description: z.string().min(1), // confirms string has min length of 1 -}); - -// send request -export async function POST(request: NextRequest) { - // return request with a promise - const body = await request.json(); - - // validate the data - const validation = createIssueSchema.safeParse(body); - if (!validation.success) - return NextResponse.json(validation.error.errors, {status: 400}) // Send error 400 if data is invalid - - const newIssue = await prisma.issue.create({ - data: { title: body.title, description: body.description } - }); - - // return the issue to the client - return NextResponse.json(newIssue, {status: 201}); // status 201 means an object was created -} \ No newline at end of file diff --git a/Websites/jefes-nextjs/app/components/NavBar/NavBar.css b/Websites/jefes-nextjs/app/components/NavBar/NavBar.css index 9799072..e2accea 100644 --- a/Websites/jefes-nextjs/app/components/NavBar/NavBar.css +++ b/Websites/jefes-nextjs/app/components/NavBar/NavBar.css @@ -1,9 +1,18 @@ -.nav_background{ - z-index: -1; - filter: brightness(.17); - /* align-items: baseline; */ +.nav_background { + z-index: -1; + filter: brightness(0.17); + /* align-items: baseline; */ +} +.logo { + margin: 0 auto; + align-items: center; +} + +.active { + background: green; + position: fixed; + width: 100%; + justify-content: space-around; + display: flex; + align-items: center; } -.logo{ - margin: 0 auto; - align-items: center; -} \ No newline at end of file diff --git a/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx b/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx index 8d12a82..834a77b 100644 --- a/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx +++ b/Websites/jefes-nextjs/app/components/NavBar/NavBar.tsx @@ -1,5 +1,5 @@ "use client"; -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import Link from "next/link"; import Image from "next/image"; import { usePathname } from "next/navigation"; @@ -16,8 +16,9 @@ import { FaTiktok } from "react-icons/fa"; const NavBar = () => { const currentPath = usePathname(); - console.log(currentPath); + // console.log(currentPath); const [menu_open, set_menu_open] = useState(false); + const [navbar, setNavbar] = useState(false); const handleNav = () => { set_menu_open(!menu_open); @@ -39,10 +40,24 @@ const NavBar = () => { // { label: "Issues", href: "/issues" }, ]; + const changeBackground = () => { + // console.log(window.scrollY); + if (window.scrollY >= 20) { + setNavbar(true); + } else { + setNavbar(false); + } + }; + if (typeof window !== "undefined") { + // Your client-side code that uses window goes here + window.addEventListener("scroll", changeBackground); + } + return ( -