From c31549f0ac06c1de777b194f5448fad28320b2ac Mon Sep 17 00:00:00 2001 From: Abhishek Raj Date: Thu, 12 Sep 2024 14:55:27 +0530 Subject: [PATCH] client side bugs fixes --- client/src/components/effects/icons.tsx | 88 ------------------------- client/src/components/ui/card.tsx | 1 - client/src/components/ui/navbar.tsx | 2 - client/src/pages/EachBlog.tsx | 4 +- client/src/pages/Signup.tsx | 6 -- server/src/index.ts | 4 +- 6 files changed, 4 insertions(+), 101 deletions(-) delete mode 100644 client/src/components/effects/icons.tsx diff --git a/client/src/components/effects/icons.tsx b/client/src/components/effects/icons.tsx deleted file mode 100644 index 8cc79f5..0000000 --- a/client/src/components/effects/icons.tsx +++ /dev/null @@ -1,88 +0,0 @@ -"use client"; - - -import { useEffect, useMemo, useState } from "react"; -import { - Cloud, - fetchSimpleIcons, - ICloud, - renderSimpleIcon, - SimpleIcon, -} from "react-icon-cloud"; - -export const cloudProps: Omit = { - containerProps: { - style: { - display: "flex", - justifyContent: "center", - alignItems: "center", - width: "100%", - paddingTop: 40, - }, - }, - options: { - reverse: true, - depth: 1, - wheelZoom: false, - imageScale: 2, - activeCursor: "default", - tooltip: "native", - initial: [0.1, -0.1], - clickToFront: 500, - tooltipDelay: 0, - outlineColour: "#0000", - maxSpeed: 0.04, - minSpeed: 0.02, - // dragControl: false, - }, -}; - -export const renderCustomIcon = (icon: SimpleIcon, theme: string) => { - const bgHex = theme === "light" ? "#f3f2ef" : "#080510"; - const fallbackHex = theme === "light" ? "#6e6e73" : "#ffffff"; - const minContrastRatio = theme === "dark" ? 2 : 1.2; - - return renderSimpleIcon({ - icon, - bgHex, - fallbackHex, - minContrastRatio, - size: 42, - aProps: { - href: undefined, - target: undefined, - rel: undefined, - onClick: (e: any) => e.preventDefault(), - }, - }); -}; - -export type DynamicCloudProps = { - iconSlugs: string[]; -}; - -type IconData = Awaited>; - -export default function IconCloud({ iconSlugs }: DynamicCloudProps) { - const [data, setData] = useState(null); - const { theme } = useTheme(); - - useEffect(() => { - fetchSimpleIcons({ slugs: iconSlugs }).then(setData); - }, [iconSlugs]); - - const renderedIcons = useMemo(() => { - if (!data) return null; - - return Object.values(data.simpleIcons).map((icon) => - renderCustomIcon(icon, theme || "light") - ); - }, [data, theme]); - - return ( - // @ts-ignore - - <>{renderedIcons} - - ); -} diff --git a/client/src/components/ui/card.tsx b/client/src/components/ui/card.tsx index 96a0463..af8481e 100644 --- a/client/src/components/ui/card.tsx +++ b/client/src/components/ui/card.tsx @@ -39,7 +39,6 @@ const slugs = [ ]; export const EvervaultCard = ({ - text, className, }: { text?: string; diff --git a/client/src/components/ui/navbar.tsx b/client/src/components/ui/navbar.tsx index 1e7f966..f85c3e1 100644 --- a/client/src/components/ui/navbar.tsx +++ b/client/src/components/ui/navbar.tsx @@ -80,8 +80,6 @@ export const Menu = ({ export const ProductItem = ({ title, description, - href, - src, }: { title: string; description: string; diff --git a/client/src/pages/EachBlog.tsx b/client/src/pages/EachBlog.tsx index be4c3f9..2f2ea51 100644 --- a/client/src/pages/EachBlog.tsx +++ b/client/src/pages/EachBlog.tsx @@ -39,9 +39,9 @@ export default function EachBlog() { if (blogsinput.createddata) { date = blogsinput.createddata.split("T")[0]; } - let readtime:number; - + if (blogsinput.createdtime) { + let readtime:number; time = blogsinput.createdtime.split("T")[1].split(".")[0]; if (Number(time.split(":")[0]) > 12) { readtime = Number(time.split(":")[0]) - 12; diff --git a/client/src/pages/Signup.tsx b/client/src/pages/Signup.tsx index 291b027..643a722 100644 --- a/client/src/pages/Signup.tsx +++ b/client/src/pages/Signup.tsx @@ -42,12 +42,6 @@ export default function Signup() { const navigate = useNavigate(); const [Signupinput, useSignupinput] = useRecoilState(UserAtom); -// const [Signupinput, useSignupinput] = useState({ -// email: "", -// password: "", -// firstname: "", -// lastname: "", -// }); console.log(Signupinput) const handlesubmit = async(e: React.FormEvent) => { diff --git a/server/src/index.ts b/server/src/index.ts index 021770d..d394f6d 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -1,5 +1,5 @@ import express from "express" -import ruotes from "./routes/index" +import routes from "./routes/index" import dotenv from "dotenv" import cors from "cors" @@ -21,7 +21,7 @@ app.get("/test",(req,res)=>{ res.send("testing works") }) -app.use('/api',ruotes) +app.use('/api',routes)