From 570258f1bd60ec66816d69ff30c799f801fc3ad5 Mon Sep 17 00:00:00 2001 From: Pulkit Date: Sun, 27 Oct 2024 00:25:32 +0530 Subject: [PATCH] fix: restructure the code --- {components/Skills => app/data}/Items.tsx | 2 +- components/Skills/index.tsx | 3 ++- components/Skills/Icons.tsx => lib/skills-Icons.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename {components/Skills => app/data}/Items.tsx (99%) rename components/Skills/Icons.tsx => lib/skills-Icons.tsx (99%) diff --git a/components/Skills/Items.tsx b/app/data/Items.tsx similarity index 99% rename from components/Skills/Items.tsx rename to app/data/Items.tsx index 569cd19..9b8041a 100644 --- a/components/Skills/Items.tsx +++ b/app/data/Items.tsx @@ -37,7 +37,7 @@ import { IconSqlAlechemy, IconTailwindcss, IconTypescript, -} from "./Icons"; +} from "../../lib/skills-Icons"; type Item = { name: string; diff --git a/components/Skills/index.tsx b/components/Skills/index.tsx index 806d0c5..23cb589 100644 --- a/components/Skills/index.tsx +++ b/components/Skills/index.tsx @@ -1,6 +1,6 @@ "use client"; import React, { useEffect, useMemo, useState } from "react"; -import { displayItems } from "./Items"; +import { displayItems } from "../../app/data/Items"; import { Accordion, AccordionContent, @@ -20,6 +20,7 @@ export default function Skills() { setWindowWidth(window.innerWidth); }; window.addEventListener("resize", handleResize); + handleResize(); return () => window.removeEventListener("resize", handleResize); }, []); diff --git a/components/Skills/Icons.tsx b/lib/skills-Icons.tsx similarity index 99% rename from components/Skills/Icons.tsx rename to lib/skills-Icons.tsx index c829649..0e83e7b 100644 --- a/components/Skills/Icons.tsx +++ b/lib/skills-Icons.tsx @@ -1,4 +1,4 @@ -import { ICON_SIZE } from "../Blogs/types"; +import { ICON_SIZE } from "../components/Blogs/types"; const getSizeConfig = (size: ICON_SIZE, isSizeLarge: boolean = false) => isSizeLarge