From 071e5e4a12534b984e34e3b615cc1df6929fb9ae Mon Sep 17 00:00:00 2001 From: gibbyb Date: Tue, 17 Sep 2024 14:28:50 -0500 Subject: [PATCH] Fix stuff for mobile --- src/components/general/aboutme.tsx | 13 +- src/components/general/techchart.tsx | 7 +- src/components/projects/fuse.tsx | 8 +- src/components/projects/lazyprimeagen.tsx | 4 +- src/components/projects/sunhat.tsx | 4 +- src/components/projects/techtracker.tsx | 4 +- src/components/projects/tenantportal.tsx | 4 +- src/components/projects/wiredworld.tsx | 4 +- src/components/ui/chart.tsx | 2 +- src/components/ui/chart2.tsx | 371 ++++++++++++++++++++++ 10 files changed, 397 insertions(+), 24 deletions(-) create mode 100644 src/components/ui/chart2.tsx diff --git a/src/components/general/aboutme.tsx b/src/components/general/aboutme.tsx index b5c3bd2..4d43f73 100644 --- a/src/components/general/aboutme.tsx +++ b/src/components/general/aboutme.tsx @@ -5,15 +5,16 @@ const AboutMe = () => {

About Me

I am a recent USM graduate with a Bachelor's degree in Computer Science. - Despite my short time in Software Engineering, I have an extensive portfolio - of Web Applications & broad range of knowledge & experience in many different + Despite my short time in software development, I have an extensive portfolio + of web applications & a broad range of knowledge & experience in many different stacks & technologies. You can also be sure that any project I create will be - completely self-hosted on my Fedora Server! + completely self-hosted on my Fedora Server using technologies such as Docker, + Caddy, Node, PHP-FPM, PostgreSQL, MySQL, & more!

- I am a big fan of TypeScript and I have been - exclusively using it in my web projects for the past year with frameworks such as - Next.js & React Native. I also have experience building applications & backends + I am a huge fan of TypeScript and I have been exclusively using it in my web + projects for the past year with frameworks such as Next.js, React, & React + Native. I also have experience building applications & backends using the technologies listed below!

diff --git a/src/components/general/techchart.tsx b/src/components/general/techchart.tsx index dcf5e87..58dcf04 100644 --- a/src/components/general/techchart.tsx +++ b/src/components/general/techchart.tsx @@ -10,7 +10,7 @@ import { ChartContainer, ChartTooltip, ChartTooltipContent, -} from "~/components/ui/chart" +} from "~/components/ui/chart2" const chartData = [ { technology: "Linux", proficiency: 95 }, @@ -44,8 +44,8 @@ export default function Component() { data={chartData} layout="vertical" margin={{ - left: 60, - right: 60, + left: 0, + right: 0, top: 0, bottom: 0, }} @@ -58,6 +58,7 @@ export default function Component() { axisLine={false} tickLine={false} fontSize={12} + width={1000} /> - + -
-

+
+

Fuse (React Native, Next.js, & PostgreSQL)

- < FaGithub className="my-auto ml-2" size={22} /> + < FaGithub className="my-auto ml-2 mr-4" size={22} />
diff --git a/src/components/projects/lazyprimeagen.tsx b/src/components/projects/lazyprimeagen.tsx index 17a1512..3a5e395 100644 --- a/src/components/projects/lazyprimeagen.tsx +++ b/src/components/projects/lazyprimeagen.tsx @@ -10,11 +10,11 @@ import { FaGithub } from "react-icons/fa"; export default function LazyPrimeagen() { return (
- +
-

+

Lazy Primeagen Neovim Config (Lua)

- +
-

Sunhat (Bash)

+

Sunhat (Bash)

diff --git a/src/components/projects/techtracker.tsx b/src/components/projects/techtracker.tsx index 1c10087..c57c653 100644 --- a/src/components/projects/techtracker.tsx +++ b/src/components/projects/techtracker.tsx @@ -10,10 +10,10 @@ import { FaGithub } from "react-icons/fa"; export default function TechTracker() { return (
- + -

Tech Tracker (Next.js, Swift & MySQL)

+

Tech Tracker (Next.js, Swift & MySQL)

diff --git a/src/components/projects/tenantportal.tsx b/src/components/projects/tenantportal.tsx index f7b9f29..57296b6 100644 --- a/src/components/projects/tenantportal.tsx +++ b/src/components/projects/tenantportal.tsx @@ -10,11 +10,11 @@ import { FaGithub } from "react-icons/fa"; export default function TenantPortal() { return (
- +
-

+

Tenant Portal (Next.js & PostgreSQL)

- +
-

+

Wired World (PHP & MySQL)

(({ id, className, children, config, ...props }, ref) => { const uniqueId = React.useId() - const chartId = `chart-${id || uniqueId.replace(/:/g, "")}` + const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}` return ( diff --git a/src/components/ui/chart2.tsx b/src/components/ui/chart2.tsx new file mode 100644 index 0000000..eb00e31 --- /dev/null +++ b/src/components/ui/chart2.tsx @@ -0,0 +1,371 @@ +"use client" + +import * as React from "react" +import * as RechartsPrimitive from "recharts" +import { + NameType, + Payload, + ValueType, +} from "recharts/types/component/DefaultTooltipContent" + +import { cn } from "~/lib/utils" + +// Format: { THEME_NAME: CSS_SELECTOR } +const THEMES = { light: "", dark: ".dark" } as const + +export type ChartConfig = { + [k in string]: { + label?: React.ReactNode + icon?: React.ComponentType + } & ( + | { color?: string; theme?: never } + | { color?: never; theme: Record } + ) +} + +type ChartContextProps = { + config: ChartConfig +} + +const ChartContext = React.createContext(null) + +function useChart() { + const context = React.useContext(ChartContext) + + if (!context) { + throw new Error("useChart must be used within a ") + } + + return context +} + +const ChartContainer = React.forwardRef< + HTMLDivElement, + React.ComponentProps<"div"> & { + config: ChartConfig + children: React.ComponentProps< + typeof RechartsPrimitive.ResponsiveContainer + >["children"] + } +>(({ id, className, children, config, ...props }, ref) => { + const uniqueId = React.useId() + const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}` + + return ( + +
+ + + {children} + +
+
+ ) +}) +ChartContainer.displayName = "Chart" + +const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => { + const colorConfig = Object.entries(config).filter( + ([_, config]) => config.theme ?? config.color + ) + + if (!colorConfig.length) { + return null + } + + return ( +