From 4d91f03734725df0b5078183dae8e49a72be1353 Mon Sep 17 00:00:00 2001 From: Davidson3556 <99369614+Davidson3556@users.noreply.github.com> Date: Thu, 3 Oct 2024 20:14:29 +0100 Subject: [PATCH 1/2] all pages errors fix --- .eslintrc.json | 3 +-- app/(landing)/contact/page.tsx | 10 +++++----- app/payment/_component/footer_payment.tsx | 8 ++++---- .../_component/payment-type-layout.tsx | 6 +++--- .../errorpage/_components/err-type-layout.tsx | 6 +++--- app/payment/page.tsx | 7 +------ components/commons/floating-navbar.tsx | 3 +-- components/commons/footer-primary.tsx | 2 +- components/commons/tailwind-buttons.tsx | 2 +- components/ui/input.tsx | 18 +++++++----------- components/ui/textarea.tsx | 18 +++++++----------- lib/handle-err.ts | 19 ++++++++++++++----- package-lock.json | 11 +++++++++++ package.json | 1 + 14 files changed, 60 insertions(+), 54 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index e976031..ba8d2cf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,4 @@ { - // "extends": ["next/core-web-vitals", "next/typescript"], - "extends": "next/core-web-vitals", + "extends": ["next/core-web-vitals", "next/typescript"], "rules": { "react/no-unescaped-entities": 0 } } diff --git a/app/(landing)/contact/page.tsx b/app/(landing)/contact/page.tsx index 32e8975..4a97925 100644 --- a/app/(landing)/contact/page.tsx +++ b/app/(landing)/contact/page.tsx @@ -23,11 +23,11 @@ import { handleApiError } from "@/lib/handle-err"; import WidthLayout from "@/components/commons/width-layout"; // Define the type for social media links -interface SocialMediaLink { - name: string; - url: string; - icon: string; -} +// interface SocialMediaLink { +// name: string; +// url: string; +// icon: string; +// } diff --git a/app/payment/_component/footer_payment.tsx b/app/payment/_component/footer_payment.tsx index fa8ad9c..e445783 100644 --- a/app/payment/_component/footer_payment.tsx +++ b/app/payment/_component/footer_payment.tsx @@ -2,10 +2,10 @@ import React from "react"; import Image from "next/image"; // Define the type for social media links -interface SocialMediaLink { - name: string; - url: string; - icon: string; +interface socialMediaLinks { +name: string; +url: string; +icon: string; } // You would typically define this array in a separate file or fetch it from an API diff --git a/app/payment/_component/payment-type-layout.tsx b/app/payment/_component/payment-type-layout.tsx index b85948b..d5a2728 100644 --- a/app/payment/_component/payment-type-layout.tsx +++ b/app/payment/_component/payment-type-layout.tsx @@ -1,8 +1,8 @@ // components/err-type-layout -import Link from "next/link"; -import { Button } from "@/components/ui/button"; -import Image from "next/image"; +// import Link from "next/link"; +// import { Button } from "@/components/ui/button"; +// import Image from "next/image"; import { ReactNode } from "react"; import Header from "../_component/header_payment"; import Footer from "../_component/footer_payment"; diff --git a/app/payment/errorpage/_components/err-type-layout.tsx b/app/payment/errorpage/_components/err-type-layout.tsx index f869dac..1a1763f 100644 --- a/app/payment/errorpage/_components/err-type-layout.tsx +++ b/app/payment/errorpage/_components/err-type-layout.tsx @@ -1,8 +1,8 @@ // components/err-type-layout -import Link from "next/link"; -import { Button } from "@/components/ui/button"; -import Image from "next/image"; +// import Link from "next/link"; +// import { Button } from "@/components/ui/button"; +// import Image from "next/image"; import { ReactNode } from "react"; import WidthLayout from "@/components/commons/width-layout"; import InterfaceLayout from "@/app/(landing)/_components/err-Interface-layout"; diff --git a/app/payment/page.tsx b/app/payment/page.tsx index 9ac5dd5..8aa5e42 100644 --- a/app/payment/page.tsx +++ b/app/payment/page.tsx @@ -1,7 +1,7 @@ "use client"; import { Suspense, useEffect, useState } from "react"; -import { useRouter, useSearchParams } from "next/navigation"; +import { useSearchParams } from "next/navigation"; import { Button } from "@/components/ui/button"; import Image from "next/image"; import Link from "next/link"; @@ -22,11 +22,6 @@ const StatusMessage: React.FC = ({ firstName, lastName, }) => { - const handleClose = () => { - if (window.parent) { - window.parent.postMessage("closeIframe", "*"); - } - }; if (isAlreadyVerified) { return ( diff --git a/components/commons/floating-navbar.tsx b/components/commons/floating-navbar.tsx index 2ee3347..582ec7c 100644 --- a/components/commons/floating-navbar.tsx +++ b/components/commons/floating-navbar.tsx @@ -9,7 +9,7 @@ import { } from "framer-motion"; import { cn } from "@/lib/utils"; import Link from "next/link"; -import Image from "next/image"; +// import Image from "next/image"; import { usePathname, useRouter } from "next/navigation"; export const FloatingNav = ({ @@ -54,7 +54,6 @@ export const FloatingNav = ({ useMotionValueEvent(scrollYProgress, "change", (current) => { if (typeof current === "number" && isScrollable) { - let direction = current - scrollYProgress.getPrevious()!; setVisible(true); } diff --git a/components/commons/footer-primary.tsx b/components/commons/footer-primary.tsx index 7690176..c1dd499 100644 --- a/components/commons/footer-primary.tsx +++ b/components/commons/footer-primary.tsx @@ -37,7 +37,7 @@ const socialMediaLinks: SocialMediaLink[] = [ ]; const Footer: React.FC = () => { - const currentYear = new Date().getFullYear(); + // const currentYear = new Date().getFullYear(); return (
diff --git a/components/commons/tailwind-buttons.tsx b/components/commons/tailwind-buttons.tsx index af1cdec..5627674 100644 --- a/components/commons/tailwind-buttons.tsx +++ b/components/commons/tailwind-buttons.tsx @@ -1,7 +1,7 @@ "use client"; import React from "react"; import { ButtonsCard } from "../ui/aceternity-buttons"; -import Link from "next/link"; +// import Link from "next/link"; interface ButtonProps { svgIcon: React.ReactNode; diff --git a/components/ui/input.tsx b/components/ui/input.tsx index 5af26b2..04c1253 100644 --- a/components/ui/input.tsx +++ b/components/ui/input.tsx @@ -1,11 +1,7 @@ -import * as React from "react" +import * as React from "react"; +import { cn } from "@/lib/utils"; -import { cn } from "@/lib/utils" - -export interface InputProps - extends React.InputHTMLAttributes {} - -const Input = React.forwardRef( +const Input = React.forwardRef>( ({ className, type, ...props }, ref) => { return ( ( ref={ref} {...props} /> - ) + ); } -) -Input.displayName = "Input" +); +Input.displayName = "Input"; -export { Input } +export { Input }; diff --git a/components/ui/textarea.tsx b/components/ui/textarea.tsx index d1258e4..4ed69a8 100644 --- a/components/ui/textarea.tsx +++ b/components/ui/textarea.tsx @@ -1,11 +1,7 @@ -import * as React from "react" +import * as React from "react"; +import { cn } from "@/lib/utils"; -import { cn } from "@/lib/utils" - -export interface TextareaProps - extends React.TextareaHTMLAttributes {} - -const Textarea = React.forwardRef( +const Textarea = React.forwardRef>( ({ className, ...props }, ref) => { return (