diff --git a/src/app/(calculators)/calculate/[section]/[id]/page.tsx b/src/app/(calculators)/calculate/[section]/[id]/page.tsx new file mode 100644 index 0000000..6a6167e --- /dev/null +++ b/src/app/(calculators)/calculate/[section]/[id]/page.tsx @@ -0,0 +1,12 @@ +import Input from "@/app/utils/Input"; + +export default async function Calculator({params} : {params:Promise<{section:string, id:string}>}){ + const calcData : {section:string, id:string} = await params; + return( + <> +

Section:- {calcData.section}

+

Calculator ID:- {calcData.id}

+ + + ) +} \ No newline at end of file diff --git a/src/app/(calculators)/calculators/page.tsx b/src/app/(calculators)/calculators/page.tsx index 96da397..b100241 100644 --- a/src/app/(calculators)/calculators/page.tsx +++ b/src/app/(calculators)/calculators/page.tsx @@ -1,17 +1,7 @@ "use client" -import Navbar from "@/app/utils/Navbar" -import Sidemenu from "@/app/utils/Sidemenu"; -import { useState } from "react"; - export default function Calculators(){ - const [navbar, setNavbar] = useState(false); return( -
- - -
-
-
- ); + <>

hi

+ ) } \ No newline at end of file diff --git a/src/app/(calculators)/layout.tsx b/src/app/(calculators)/layout.tsx new file mode 100644 index 0000000..cdb4466 --- /dev/null +++ b/src/app/(calculators)/layout.tsx @@ -0,0 +1,9 @@ +import LayoutClient from "./layoutClient"; + +export default function CalculatorsLayout({children} : {children:React.ReactNode}){ + return( + <> + {children} + + ) +} \ No newline at end of file diff --git a/src/app/(calculators)/layoutClient.tsx b/src/app/(calculators)/layoutClient.tsx new file mode 100644 index 0000000..5434e1f --- /dev/null +++ b/src/app/(calculators)/layoutClient.tsx @@ -0,0 +1,18 @@ +"use client" +import { useState } from "react"; +import Sidemenu from "../utils/Sidemenu"; +import Navbar from "../utils/Navbar"; + +export default function LayoutClient({children} : {children:React.ReactNode}){ + const [navbar, setNavbar] = useState(false); + return( +
+ + +
+ {children} +
+
+
+ ); +} \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index a638af1..574394d 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -21,6 +21,7 @@ .content{ grid-area: content; background: #F9FAFB; /* soft white */ + color: black; } .footer{ grid-area: footer; diff --git a/src/app/page.tsx b/src/app/page.tsx index d1e61da..f5f481e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,7 @@ -import Image from "next/image"; +"use client" -export default function Home() { - return ( - <> - ); -} +export default function Home(){ + return( + <> + ); +} \ No newline at end of file diff --git a/src/app/utils/Input.tsx b/src/app/utils/Input.tsx new file mode 100644 index 0000000..2fc6d8a --- /dev/null +++ b/src/app/utils/Input.tsx @@ -0,0 +1,11 @@ +export default function Input(){ + return( + <> +
+ Page title + +

You can edit page title later on from settings

+
+ + ); +} \ No newline at end of file diff --git a/src/app/utils/Navbar.tsx b/src/app/utils/Navbar.tsx index e65c3fd..0e23207 100644 --- a/src/app/utils/Navbar.tsx +++ b/src/app/utils/Navbar.tsx @@ -29,14 +29,40 @@ export default function Navbar({navbarToggle}: Props){
- +
); diff --git a/src/app/utils/Section.tsx b/src/app/utils/Section.tsx new file mode 100644 index 0000000..4837ed2 --- /dev/null +++ b/src/app/utils/Section.tsx @@ -0,0 +1,18 @@ +import { Calculator } from "./calculators/types"; + +export default function Section({sectionName, Calculators, id} : {sectionName:string, Calculators:Calculator[], id:string}){ + return( +
  • +
    + {sectionName} +
      + {Calculators.map((e) => { + return( +
    • {e.name}
    • + ) + })} +
    +
    +
  • + ) +} \ No newline at end of file diff --git a/src/app/utils/Sidemenu.tsx b/src/app/utils/Sidemenu.tsx index a4cd6e5..052c6da 100644 --- a/src/app/utils/Sidemenu.tsx +++ b/src/app/utils/Sidemenu.tsx @@ -1,10 +1,13 @@ "use client" +import { CalculatorRegistry } from "./calculators/registry"; +import Section from "./Section"; type Props = { isNavOpen: boolean; } export default function Sidemenu({isNavOpen}: Props){ + const sectionNames = Object.keys(CalculatorRegistry); return(
      -
    • -
      - Parent - -
      -
    • + { + sectionNames.map((e) => { + return
      + }) + }
    );