more fises

This commit is contained in:
2024-12-18 13:51:12 -05:00
parent 12493feb6e
commit 587f183ffa
13 changed files with 112 additions and 67 deletions

105
package-lock.json generated
View File

@@ -27,7 +27,7 @@
"fontsource-roboto": "^4.0.0", "fontsource-roboto": "^4.0.0",
"framer-motion": "^11.11.17", "framer-motion": "^11.11.17",
"lucide-react": "^0.460.0", "lucide-react": "^0.460.0",
"next": "15.0.3", "next": "15.1.0",
"next-themes": "^0.4.3", "next-themes": "^0.4.3",
"pg": "^8.13.1", "pg": "^8.13.1",
"react": "18.2.0", "react": "18.2.0",
@@ -2465,9 +2465,10 @@
} }
}, },
"node_modules/@next/env": { "node_modules/@next/env": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/env/-/env-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/env/-/env-15.1.0.tgz",
"integrity": "sha512-t9Xy32pjNOvVn2AS+Utt6VmyrshbpfUMhIjFO60gI58deSo/KgLOp31XZ4O+kY/Is8WAGYwA5gR7kOb1eORDBA==" "integrity": "sha512-UcCO481cROsqJuszPPXJnb7GGuLq617ve4xuAyyNG4VSSocJNtMU5Fsx+Lp6mlN8c7W58aZLc5y6D/2xNmaK+w==",
"license": "MIT"
}, },
"node_modules/@next/eslint-plugin-next": { "node_modules/@next/eslint-plugin-next": {
"version": "15.0.3", "version": "15.0.3",
@@ -2479,12 +2480,13 @@
} }
}, },
"node_modules/@next/swc-darwin-arm64": { "node_modules/@next/swc-darwin-arm64": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.0.tgz",
"integrity": "sha512-s3Q/NOorCsLYdCKvQlWU+a+GeAd3C8Rb3L1YnetsgwXzhc3UTWrtQpB/3eCjFOdGUj5QmXfRak12uocd1ZiiQw==", "integrity": "sha512-ZU8d7xxpX14uIaFC3nsr4L++5ZS/AkWDm1PzPO6gD9xWhFkOj2hzSbSIxoncsnlJXB1CbLOfGVN4Zk9tg83PUw==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
@@ -2494,12 +2496,13 @@
} }
}, },
"node_modules/@next/swc-darwin-x64": { "node_modules/@next/swc-darwin-x64": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.0.tgz",
"integrity": "sha512-Zxl/TwyXVZPCFSf0u2BNj5sE0F2uR6iSKxWpq4Wlk/Sv9Ob6YCKByQTkV2y6BCic+fkabp9190hyrDdPA/dNrw==", "integrity": "sha512-DQ3RiUoW2XC9FcSM4ffpfndq1EsLV0fj0/UY33i7eklW5akPUCo6OX2qkcLXZ3jyPdo4sf2flwAED3AAq3Om2Q==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
@@ -2509,12 +2512,13 @@
} }
}, },
"node_modules/@next/swc-linux-arm64-gnu": { "node_modules/@next/swc-linux-arm64-gnu": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.0.tgz",
"integrity": "sha512-T5+gg2EwpsY3OoaLxUIofmMb7ohAUlcNZW0fPQ6YAutaWJaxt1Z1h+8zdl4FRIOr5ABAAhXtBcpkZNwUcKI2fw==", "integrity": "sha512-M+vhTovRS2F//LMx9KtxbkWk627l5Q7AqXWWWrfIzNIaUFiz2/NkOFkxCFyNyGACi5YbA8aekzCLtbDyfF/v5Q==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@@ -2524,12 +2528,13 @@
} }
}, },
"node_modules/@next/swc-linux-arm64-musl": { "node_modules/@next/swc-linux-arm64-musl": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.0.tgz",
"integrity": "sha512-WkAk6R60mwDjH4lG/JBpb2xHl2/0Vj0ZRu1TIzWuOYfQ9tt9NFsIinI1Epma77JVgy81F32X/AeD+B2cBu/YQA==", "integrity": "sha512-Qn6vOuwaTCx3pNwygpSGtdIu0TfS1KiaYLYXLH5zq1scoTXdwYfdZtwvJTpB1WrLgiQE2Ne2kt8MZok3HlFqmg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@@ -2539,12 +2544,13 @@
} }
}, },
"node_modules/@next/swc-linux-x64-gnu": { "node_modules/@next/swc-linux-x64-gnu": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.0.tgz",
"integrity": "sha512-gWL/Cta1aPVqIGgDb6nxkqy06DkwJ9gAnKORdHWX1QBbSZZB+biFYPFti8aKIQL7otCE1pjyPaXpFzGeG2OS2w==", "integrity": "sha512-yeNh9ofMqzOZ5yTOk+2rwncBzucc6a1lyqtg8xZv0rH5znyjxHOWsoUtSq4cUTeeBIiXXX51QOOe+VoCjdXJRw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@@ -2554,12 +2560,13 @@
} }
}, },
"node_modules/@next/swc-linux-x64-musl": { "node_modules/@next/swc-linux-x64-musl": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.0.tgz",
"integrity": "sha512-QQEMwFd8r7C0GxQS62Zcdy6GKx999I/rTO2ubdXEe+MlZk9ZiinsrjwoiBL5/57tfyjikgh6GOU2WRQVUej3UA==", "integrity": "sha512-t9IfNkHQs/uKgPoyEtU912MG6a1j7Had37cSUyLTKx9MnUpjj+ZDKw9OyqTI9OwIIv0wmkr1pkZy+3T5pxhJPg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@@ -2569,12 +2576,13 @@
} }
}, },
"node_modules/@next/swc-win32-arm64-msvc": { "node_modules/@next/swc-win32-arm64-msvc": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.0.tgz",
"integrity": "sha512-9TEp47AAd/ms9fPNgtgnT7F3M1Hf7koIYYWCMQ9neOwjbVWJsHZxrFbI3iEDJ8rf1TDGpmHbKxXf2IFpAvheIQ==", "integrity": "sha512-WEAoHyG14t5sTavZa1c6BnOIEukll9iqFRTavqRVPfYmfegOAd5MaZfXgOGG6kGo1RduyGdTHD4+YZQSdsNZXg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
@@ -2584,12 +2592,13 @@
} }
}, },
"node_modules/@next/swc-win32-x64-msvc": { "node_modules/@next/swc-win32-x64-msvc": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.0.3.tgz", "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.0.tgz",
"integrity": "sha512-VNAz+HN4OGgvZs6MOoVfnn41kBzT+M+tB+OK4cww6DNyWS6wKaDpaAm/qLeOUbnMh0oVx1+mg0uoYARF69dJyA==", "integrity": "sha512-J1YdKuJv9xcixzXR24Dv+4SaDKc2jj31IVUEMdO5xJivMTXuE6MAdIi4qPjSymHuFG8O5wbfWKnhJUcHHpj5CA==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
"license": "MIT",
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
@@ -2876,11 +2885,12 @@
"integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==" "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="
}, },
"node_modules/@swc/helpers": { "node_modules/@swc/helpers": {
"version": "0.5.13", "version": "0.5.15",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.13.tgz", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz",
"integrity": "sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==", "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"tslib": "^2.4.0" "tslib": "^2.8.0"
} }
}, },
"node_modules/@tanstack/react-virtual": { "node_modules/@tanstack/react-virtual": {
@@ -6780,13 +6790,14 @@
"dev": true "dev": true
}, },
"node_modules/next": { "node_modules/next": {
"version": "15.0.3", "version": "15.1.0",
"resolved": "https://registry.npmjs.org/next/-/next-15.0.3.tgz", "resolved": "https://registry.npmjs.org/next/-/next-15.1.0.tgz",
"integrity": "sha512-ontCbCRKJUIoivAdGB34yCaOcPgYXr9AAkV/IwqFfWWTXEPUgLYkSkqBhIk9KK7gGmgjc64B+RdoeIDM13Irnw==", "integrity": "sha512-QKhzt6Y8rgLNlj30izdMbxAwjHMFANnLwDwZ+WQh5sMhyt4lEBqDK9QpvWHtIM4rINKPoJ8aiRZKg5ULSybVHw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@next/env": "15.0.3", "@next/env": "15.1.0",
"@swc/counter": "0.1.3", "@swc/counter": "0.1.3",
"@swc/helpers": "0.5.13", "@swc/helpers": "0.5.15",
"busboy": "1.6.0", "busboy": "1.6.0",
"caniuse-lite": "^1.0.30001579", "caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31", "postcss": "8.4.31",
@@ -6799,22 +6810,22 @@
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0" "node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"@next/swc-darwin-arm64": "15.0.3", "@next/swc-darwin-arm64": "15.1.0",
"@next/swc-darwin-x64": "15.0.3", "@next/swc-darwin-x64": "15.1.0",
"@next/swc-linux-arm64-gnu": "15.0.3", "@next/swc-linux-arm64-gnu": "15.1.0",
"@next/swc-linux-arm64-musl": "15.0.3", "@next/swc-linux-arm64-musl": "15.1.0",
"@next/swc-linux-x64-gnu": "15.0.3", "@next/swc-linux-x64-gnu": "15.1.0",
"@next/swc-linux-x64-musl": "15.0.3", "@next/swc-linux-x64-musl": "15.1.0",
"@next/swc-win32-arm64-msvc": "15.0.3", "@next/swc-win32-arm64-msvc": "15.1.0",
"@next/swc-win32-x64-msvc": "15.0.3", "@next/swc-win32-x64-msvc": "15.1.0",
"sharp": "^0.33.5" "sharp": "^0.33.5"
}, },
"peerDependencies": { "peerDependencies": {
"@opentelemetry/api": "^1.1.0", "@opentelemetry/api": "^1.1.0",
"@playwright/test": "^1.41.2", "@playwright/test": "^1.41.2",
"babel-plugin-react-compiler": "*", "babel-plugin-react-compiler": "*",
"react": "^18.2.0 || 19.0.0-rc-66855b96-20241106", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
"react-dom": "^18.2.0 || 19.0.0-rc-66855b96-20241106", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
"sass": "^1.3.0" "sass": "^1.3.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {

View File

@@ -3,7 +3,7 @@
"version": "0.2.0", "version": "0.2.0",
"private": "true", "private": "true",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "lint": "next lint"
@@ -28,7 +28,7 @@
"fontsource-roboto": "^4.0.0", "fontsource-roboto": "^4.0.0",
"framer-motion": "^11.11.17", "framer-motion": "^11.11.17",
"lucide-react": "^0.460.0", "lucide-react": "^0.460.0",
"next": "15.0.3", "next": "15.1.0",
"next-themes": "^0.4.3", "next-themes": "^0.4.3",
"pg": "^8.13.1", "pg": "^8.13.1",
"react": "18.2.0", "react": "18.2.0",

View File

@@ -1,6 +1,6 @@
import { ChevronDownIcon } from "@heroicons/react/20/solid"; import { ChevronDownIcon } from "@heroicons/react/20/solid";
import { getPSA, getLowerBuildKits, getGrips } from "@queries/PSA"; import { getPSA, getLowerBuildKits, getGrips } from "@queries/PSA";
import { psa } from "@db/schema/Psa"; import { psa } from "@schemas/schema";
import partTypes from "src/data/parts_cats.json"; import partTypes from "src/data/parts_cats.json";
export default async function BuilderPage() { export default async function BuilderPage() {

View File

@@ -2,6 +2,8 @@ import { getProductType } from "@queries/PSA";
import styles from '../styles.module.css'; import styles from '../styles.module.css';
import PageHero from "@src/components/PageHero"; import PageHero from "@src/components/PageHero";
import SortTable from "@src/components/SortTable"; import SortTable from "@src/components/SortTable";
import { Suspense } from "react";
import Loading from "@src/app/components/Loading/loading";
export default async function BarrelsPage() { export default async function BarrelsPage() {
const data = await getProductType('Barrels'); const data = await getProductType('Barrels');
@@ -9,9 +11,13 @@ export default async function BarrelsPage() {
return ( return (
<div> <div>
<PageHero title="Barrels" /> <PageHero title="Barrels" />
<div className="container mx-auto"> <div className="container mx-auto">
<SortTable data={data}></SortTable> <Suspense fallback="Loading...">
<SortTable data={data}></SortTable>
</Suspense>
</div> </div>
</div> </div>
); );
} }

View File

@@ -0,0 +1,6 @@
const Loading = async () => {
return (
<div className="text-center mt-14">Loading...</div>);
}
export default Loading;

View File

@@ -0,0 +1,6 @@
const Loading = async () => {
return (
<div className="text-center mt-14">Loading...</div>);
}
export default Loading;

View File

@@ -0,0 +1,8 @@
'use server'
export const TestProductPage = async (props: any) => {
return (
<div className="fixed pin z-50 overflow-auto bg-smoke-light flex">
{props.data.modelnumber}
</div>
);
}

View File

@@ -1,10 +1,8 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import constants from '@lib/constants'; import constants from '@lib/constants';
import Typography from '@mui/material/Typography'; import styles from './styles.module.css';
import MuiLink from '@mui/material/Link'; import Link from 'next/link';
import styles from './styles.module.css' import styled from '@emotion/styled';
import Link from 'next/link'
import styled from '@emotion/styled'
export default class Copyright extends Component { export default class Copyright extends Component {

View File

@@ -5,7 +5,7 @@ import styles from './styles.module.css';
import constants from '@lib/constants' import constants from '@lib/constants'
import {SITE_CONT_TYPE} from '@lib/constants' import {SITE_CONT_TYPE} from '@lib/constants'
export default function Disclosure(props) { export default function Disclosure(props:any) {
return ( return (

View File

@@ -3,10 +3,13 @@ import { PlusCircleIcon } from "@heroicons/react/20/solid";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import { TestProductPage } from "../../app/components/TestProductPage";
import { Suspense } from "react";
export default async function SortTable(props: any) { export default async function SortTable(props: any) {
return ( return (
<div className="pb-12"> <div className="pb-12">
<div className="mt-8 flow-root"> <div className="mt-8 flow-root">
<div className="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"> <div className="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"> <div className="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
@@ -125,13 +128,18 @@ export default async function SortTable(props: any) {
/> />
</button> </button>
</td> </td>
</tr> <td style={{display:'none'}}>
<TestProductPage data={item}></TestProductPage>
</td>
</tr>
))} ))}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
); );
} }

View File

@@ -1,3 +1,5 @@
import Link from "next/link";
export default function Newsletter() { export default function Newsletter() {
return ( return (
<div className="bg-gray-900 py-16 sm:py-24 lg:py-32"> <div className="bg-gray-900 py-16 sm:py-24 lg:py-32">
@@ -28,9 +30,9 @@ export default function Newsletter() {
</div> </div>
<p className="mt-4 text-sm/6 text-gray-300"> <p className="mt-4 text-sm/6 text-gray-300">
We care about your data. Read our{' '} We care about your data. Read our{' '}
<a href="#" className="font-semibold text-white"> <Link href="/PP" className="font-semibold text-white">
privacy&nbsp;policy privacy&nbsp;policy
</a> </Link>
. .
</p> </p>
</form> </form>

View File

@@ -26,7 +26,7 @@ export async function getLowerBuildKits(page = 1) {
} }
export async function getARCompleteLowers(page = 1) { export async function getARCompleteLowers(page = 1) {
const limit = 40; const limit = 240;
const offset = (page - 1) * limit; const offset = (page - 1) * limit;
return await db.select() return await db.select()
@@ -39,7 +39,7 @@ export async function getARCompleteLowers(page = 1) {
export async function getProductType(productType : any, page = 1) { export async function getProductType(productType : any, page = 1) {
const limit = 40; const limit = 40;
const offset = (page - 1) * limit; const offset = (page - 1) * limit;
await new Promise((resolve) => setTimeout(resolve,1000));
return await db.select() return await db.select()
.from(psa) .from(psa)
.limit(limit) .limit(limit)

View File

@@ -1,25 +1,25 @@
// db/queries.ts // db/queries.ts
"use server"; "use server";
import { eq, not , asc} from "drizzle-orm"; import { eq, not , asc} from "drizzle-orm";
import { Product } from '@schemas/Product'; import { products } from '@schemas/schema';
import { db } from '../../index'; import { db } from '../../index';
// Fetch all products // Fetch all products
export async function getAllProducts() { export async function getAllProducts() {
return await db.select().from(Product); return await db.select().from(products);
} }
// Add a new product // Add a new product
export async function addProduct() { export async function addProduct() {
return await db.insert(Product).values({ }).returning(); return await db.insert(products).values({ }).returning();
} }
// Update a Product // Update a Product
export async function updateProduct( ) { export async function updateProduct( ) {
return await db.update(Product).set({ }).where(eq(Product.id, id)); return await db.update(products).set({ }).where(eq(Product.id, id));
} }
// Delete a product // Delete a product
export async function deleteProduct(id: number) { export async function deleteProduct(id: number) {
return await db.delete(Product).where(eq(Product.id, id)); return await db.delete(products).where(eq(products.id, id));
} }