Skip to content

Commit

Permalink
Fix favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdburdick committed Jun 16, 2024
1 parent 60a3fd9 commit 64998ac
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 133 deletions.
16 changes: 0 additions & 16 deletions src/api/favicon.md

This file was deleted.

22 changes: 17 additions & 5 deletions src/app/_content/Experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import { cn } from "@/lib/utils"
export default function Experience() {
const { data } = useApi()
const experience: ExperienceType[] = data.experience.attributes.experience

const handleAccordionChange = (value: string) => {
console.log(value)
}
const renderSkill = (skill: string, key: number) =>
!!skill ? (
<li key={key}>
Expand All @@ -30,10 +34,13 @@ export default function Experience() {
) => {
const key = `${role.company.toLowerCase()}-${index}`
return (
<li className="grid-auto-rows grid gap-4" key={key}>
<li className="grid-auto-rows grid gap-4" id={key} key={key}>
<AccordionItem value={key}>
<AccordionTrigger>
<div className="grid grid-cols-12 items-center md:flex-1">
<a
href={`#experience-${role.company}`}
className="grid grid-cols-12 items-center md:flex-1"
>
<div className="col-span-12 gap-1 text-xs text-muted-foreground md:col-span-3 md:col-start-1 xl:col-span-2 xl:text-sm">
<DateSpan date={role.date} />
</div>
Expand All @@ -52,7 +59,7 @@ export default function Experience() {
</div>
</div>
</div>
</div>
</a>
</AccordionTrigger>
<AccordionContent>
<div className="grid grid-cols-12">
Expand All @@ -75,13 +82,18 @@ export default function Experience() {
}

const renderExperience = (experience: ExperienceType, key: number) => (
<li key={`experience-${key}`} className="grid gap-2">
<li
key={`experience-${experience.company}`}
id={`experience-${experience.company}`}
className="grid gap-2"
>
<div className="grid grid-cols-12">
<div className="col-span-12 font-semibold md:col-span-8 md:col-start-4">
<RuleHeader>{experience.company}</RuleHeader>
</div>
</div>
<Accordion
onValueChange={handleAccordionChange}
type="single"
collapsible
key={`role-${key}`}
Expand All @@ -105,7 +117,7 @@ export default function Experience() {

const renderExperiences = (
<div className="container">
<ul className="grid-auto-rows grid gap-14">
<ul className="grid-auto-rows grid gap-16">
{experience
.filter((item) => item?.disabled !== true)
.map(renderExperience)}
Expand Down
Binary file removed src/app/apple-icon.png
Binary file not shown.
Binary file removed src/app/favicon.ico
Binary file not shown.
Binary file removed src/app/icon.png
Binary file not shown.
4 changes: 2 additions & 2 deletions public/assets/images/logo--slash.svg → src/app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 1 addition & 20 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { FavIcon } from "@/lib/types"
import type { Metadata } from "next"
import { Inter } from "next/font/google"
import NextHead from "next/head"

import api from "../api"
import "./globals.css"
Expand Down Expand Up @@ -38,30 +36,13 @@ export async function generateMetadata(): Promise<Metadata> {
}
}

async function Head() {
const { favicon: faviconProp } = await api()
const { meta } = faviconProp.attributes

return (
<NextHead>
<meta
name="msapplication-TileColor"
content={meta.msapplicationTileColor}
/>
<meta name="msapplication-config" content={meta.msapplicationConfig} />
<meta name="theme-color" content={meta.themeColor} />
</NextHead>
)
}

export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<Head />
<html lang="en" className="scroll-smooth">
<body className={inter.className}>{children}</body>
</html>
)
Expand Down
83 changes: 0 additions & 83 deletions src/components/global/Logo.tsx

This file was deleted.

17 changes: 10 additions & 7 deletions src/components/global/MainHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { forwardRef } from "react"

type Props = PropsWithChildren & {
className?: string;
logoSlot?: ReactNode;
};

export const MainHeader = forwardRef(
(props: Props, ref: ForwardedRef<HTMLElement>): ReactNode => {
const { className } = props
const { logoSlot = null, className } = props
const { data } = useApi()
const { name } = data.profile
const { logo } = data.site.attributes
Expand All @@ -26,12 +27,14 @@ export const MainHeader = forwardRef(
ref={ref}
>
<h1 className="dark:invert">
<Image
src={logo.url}
width={logo.width}
height={logo.height}
alt={logo.alt}
/>
{logoSlot || (
<Image
src={logo.url}
width={logo.width}
height={logo.height}
alt={logo.alt}
/>
)}
<span className="sr-only">{name}</span>
</h1>
<div className="flex items-center gap-2">
Expand Down

0 comments on commit 64998ac

Please sign in to comment.