Skip to content

Commit ae1c6d5

Browse files
committed
add fonts for logo
1 parent 4dcb041 commit ae1c6d5

File tree

6 files changed

+23
-22
lines changed

6 files changed

+23
-22
lines changed

src/Header/Component.client.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export const HeaderClient: React.FC<HeaderClientProps> = ({ data }) => {
3232
return (
3333
<header className="container relative z-20 " {...(theme ? { 'data-theme': theme } : {})}>
3434
<div className="py-8 flex justify-between">
35-
<Link href="/">
36-
<Logo loading="eager" priority="high" className="invert dark:invert-0" />
35+
<Link className="flex items-center" href="/">
36+
<Logo />
3737
</Link>
3838
<HeaderNav data={data} />
3939
</div>
113 KB
Binary file not shown.

src/app/(frontend)/fonts/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import localFont from 'next/font/local'
2+
3+
export const logo = localFont({
4+
src: [
5+
{
6+
path: './Press-Start-2P-Regular.ttf',
7+
weight: '400',
8+
style: 'normal',
9+
},
10+
],
11+
variable: '--font-logo',
12+
})

src/app/(frontend)/layout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ import { draftMode } from 'next/headers'
1515

1616
import './globals.css'
1717
import { getServerSideURL } from '@/utilities/getURL'
18+
import { logo } from './fonts'
1819

1920
export default async function RootLayout({ children }: { children: React.ReactNode }) {
2021
const { isEnabled } = await draftMode()
2122

2223
return (
23-
<html className={cn(GeistSans.variable, GeistMono.variable)} lang="en" suppressHydrationWarning>
24+
<html
25+
className={cn(GeistSans.variable, GeistMono.variable, logo.variable)}
26+
lang="en"
27+
suppressHydrationWarning
28+
>
2429
<head>
2530
<InitTheme />
2631
<link href="/favicon.ico" rel="icon" sizes="32x32" />

src/components/Logo/Logo.tsx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import clsx from 'clsx'
21
import React from 'react'
2+
import clsx from 'clsx'
33

44
interface Props {
55
className?: string
@@ -8,22 +8,5 @@ interface Props {
88
}
99

1010
export const Logo = (props: Props) => {
11-
const { loading: loadingFromProps, priority: priorityFromProps, className } = props
12-
13-
const loading = loadingFromProps || 'lazy'
14-
const priority = priorityFromProps || 'low'
15-
16-
return (
17-
/* eslint-disable @next/next/no-img-element */
18-
<img
19-
alt="Payload Logo"
20-
width={193}
21-
height={34}
22-
loading={loading}
23-
fetchPriority={priority}
24-
decoding="async"
25-
className={clsx('max-w-[9.375rem] w-full h-[34px]', className)}
26-
src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/ui/src/assets/payload-logo-light.svg"
27-
/>
28-
)
11+
return <span className={clsx('text-2xl font-bold font-logo')}>XC@F</span>
2912
}

tailwind.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const config = {
9696
fontFamily: {
9797
mono: ['var(--font-geist-mono)'],
9898
sans: ['var(--font-geist-sans)'],
99+
logo: ['var(--font-logo)'],
99100
},
100101
keyframes: {
101102
'accordion-down': {

0 commit comments

Comments
 (0)