-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: fix build bugs while moving to app router
- Loading branch information
1 parent
983c0aa
commit f3e3723
Showing
8 changed files
with
173 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import Link from "next/link"; | ||
import { TileFactory } from "../TileFactory"; | ||
import WideShot1Bit from "@/public/projects/8-bit-adder/wide-shot-1-bit.jpg"; | ||
import Diagram1Bit from "@/public/projects/8-bit-adder/1-bit-adder-diagram.png"; | ||
import Image from "next/image"; | ||
|
||
function TileLeftSide() { | ||
return ( | ||
<div> | ||
<div className="text-base"> | ||
<p> | ||
This was my first electrical engineering project. Click{" "} | ||
<Link | ||
className="font-semibold" | ||
href="/projects/8-bit-adder/1_bit_adder_image.pdf" | ||
target="_blank" | ||
> | ||
here | ||
</Link>{" "} | ||
to download the full electrical diagram or see{" "} | ||
<Link | ||
className="font-semibold" | ||
href="https://github.com/michaelfortunato/8-bit-adder" | ||
target="_blank" | ||
> | ||
here | ||
</Link>{" "} | ||
for the project (still in progress). | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function TileRightSide() { | ||
return ( | ||
<div className="flex gap-4"> | ||
<Image src={WideShot1Bit} alt="ee-setup.jpg" width={200} /> | ||
<Image src={Diagram1Bit} alt="1-bit-adder-diagram.png" width={200} /> | ||
</div> | ||
); | ||
} | ||
export function Tile() { | ||
return TileFactory( | ||
"8 Bit Adder", | ||
<TileLeftSide />, | ||
<TileRightSide />, | ||
"8-bit-adder", | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use client"; | ||
import { IconButton } from "@mui/material"; | ||
import { ReactElement, ReactNode, useState } from "react"; | ||
import FlipIcon from "@mui/icons-material/Flip"; | ||
|
||
export function StyledTile({ | ||
props, | ||
children, | ||
}: { | ||
props?: any; | ||
children: ReactNode; | ||
}) { | ||
return ( | ||
<div className="min-h-96 rounded bg-neutral-50 p-3 shadow-md"> | ||
{children} | ||
</div> | ||
); | ||
} | ||
|
||
export function TileFactory( | ||
title: string, | ||
leftHandComponent: ReactElement, | ||
rightHandComponent: ReactElement, | ||
link: string, | ||
) { | ||
const [isOpen, setIsOpen] = useState(false); | ||
return ( | ||
<StyledTile> | ||
<div className="flex flex-col gap-5"> | ||
<div className="p2 flex"> | ||
<div className="flex-1"> | ||
<h2 className="p-4 text-5xl">{title}</h2> | ||
</div> | ||
<div className="flex flex-1 flex-row-reverse"> | ||
<IconButton aria-label="View full"> | ||
<FlipIcon /> | ||
</IconButton> | ||
</div> | ||
</div> | ||
<div className="flex gap-1"> | ||
<div className="flex-1 p-4">{leftHandComponent}</div> | ||
<div className="flex-1">{rightHandComponent}</div> | ||
</div> | ||
</div> | ||
</StyledTile> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use client"; | ||
import { motion } from "framer-motion"; | ||
import Link from "next/link"; | ||
import { PropsWithChildren } from "react"; | ||
|
||
export default function Layout({ children }: PropsWithChildren) { | ||
return ( | ||
<div className="h-screen bg-neutral-50 p-10"> | ||
<motion.div layoutId="page"> | ||
<div className="flex flex-row-reverse"> | ||
<Link href="/projects"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
strokeWidth={1.5} | ||
stroke="currentColor" | ||
className="h-6 w-6 cursor-pointer" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" | ||
/> | ||
</svg> | ||
</Link> | ||
</div> | ||
<div>{children}</div> | ||
</motion.div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.