Skip to content

Commit

Permalink
style: use local font instead of web font
Browse files Browse the repository at this point in the history
  • Loading branch information
moolmin committed Oct 1, 2024
1 parent d460c18 commit dd6cc91
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"styled-components": "^6.1.12",
"swiper": "^11.1.9",
"vite": "^5.4.1",
"zustand": "^4.5.5"
"zustand": "^5.0.0-rc.2"
},
"devDependencies": {
"@svgr/webpack": "^8.1.0",
Expand Down
Binary file added public/fonts/SpoqaHanSansNeo-Bold.woff2
Binary file not shown.
Binary file added public/fonts/SpoqaHanSansNeo-Medium.woff2
Binary file not shown.
Binary file added public/fonts/SpoqaHanSansNeo-Regular.woff2
Binary file not shown.
15 changes: 10 additions & 5 deletions src/app/(layouts)/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ export default function Header() {
if (accessToken && tokenExpiration) {
sessionStorage.setItem("AccessToken", accessToken);
sessionStorage.setItem("TokenExpiration", tokenExpiration.toString());

setAccessToken(accessToken);
setLogin(true);
setLogin(true);
} else {
logout();
logout();
}
} catch (error) {
console.error("Failed to refresh access token:", error);
Expand All @@ -104,7 +104,7 @@ export default function Header() {
}, [path]);

useEffect(() => {
checkAndRefreshToken();
checkAndRefreshToken();
}, []);

return (
Expand Down Expand Up @@ -133,7 +133,11 @@ export default function Header() {
<div className={styles.menuTopContainer}>
<img src={logo_white.src} alt="Logo" />
<div className={styles.feedbackBtnContainer}>
<Button className={styles.feedbackBtn} size="small" onClick={navFeedback}>
<Button
className={styles.feedbackBtn}
size="small"
onClick={navFeedback}
>
피드백
</Button>
</div>
Expand Down Expand Up @@ -201,6 +205,7 @@ export default function Header() {
title="뒤로가기"
open={isModalOpen}
onCancel={handleCancel}
width={450}
centered
footer={[
<Button key="cancel" onClick={handleCancel}>
Expand Down
1 change: 0 additions & 1 deletion src/app/(pages)/(landing)/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
display: flex;
flex-direction: column;
align-items: center;
transition: background-color 1s ease;
}
2 changes: 1 addition & 1 deletion src/app/(pages)/4q-create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function Page() {
<Modal
open={isModalOpen}
onCancel={handleCancel}
width={400}
width={450}
centered
footer={
<div style={{ textAlign: "center" }}>
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import url(//spoqa.github.io/spoqa-han-sans/css/SpoqaHanSansNeo.css);
/* @import url(//spoqa.github.io/spoqa-han-sans/css/SpoqaHanSansNeo.css); */

.container {
font-family: "Spoqa Han Sans Neo", sans-serif;
/* font-family: "Spoqa Han Sans Neo", sans-serif; */
font-style: normal;
max-width: 600px;
height: 100vh;
Expand Down
28 changes: 25 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,33 @@ import { Metadata } from "next";
import Head from "next/head";
import Header from "./(layouts)/header";
import styles from "./layout.module.css";
import GoogleAnalytics from "../lib/GoogleAnalytics";
import GoogleAnalytics from "@/lib/GoogleAnalytics";
import { GoogleTagManager } from "@next/third-parties/google";

import localFont from 'next/font/local'
import { UserProvider } from "@/context/UserContext";

const spoqaHanSansNeo = localFont({
src: [
{
path: "../../public/fonts/SpoqaHanSansNeo-Bold.woff2",
weight: "700",
style: "normal",
},
{
path: "../../public/fonts/SpoqaHanSansNeo-Medium.woff2",
weight: "500",
style: "normal",
},
{
path: "../../public/fonts/SpoqaHanSansNeo-Regular.woff2",
weight: "400",
style: "normal",
},
],
variable: "--font-spoqaHanSansNeo",
});


export const metadata: Metadata = {
robots: { index: true, follow: true },
metadataBase: new URL("https://qqqq.world"),
Expand Down Expand Up @@ -44,7 +66,7 @@ const config: ThemeConfig = {

export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<html lang="ko" className={spoqaHanSansNeo.className}> {/* 폰트 적용 */}
<Head>
<meta
name="viewport"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 4 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5473,11 +5473,6 @@ use-image@^1.1.0:
resolved "https://registry.yarnpkg.com/use-image/-/use-image-1.1.1.tgz#bdd3f2e1718393ffc0e56136f993467103d9d2df"
integrity sha512-n4YO2k8AJG/BcDtxmBx8Aa+47kxY5m335dJiCQA5tTeVU4XdhrhqR6wT0WISRXwdMEOv5CSjqekDZkEMiiWaYQ==

[email protected]:
version "1.2.2"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz#c3b6390f3a30eba13200d2302dcdf1e7b57b2ef9"
integrity sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==

util-deprecate@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
Expand Down Expand Up @@ -5623,9 +5618,7 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

zustand@^4.5.5:
version "4.5.5"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.5.5.tgz#f8c713041543715ec81a2adda0610e1dc82d4ad1"
integrity sha512-+0PALYNJNgK6hldkgDq2vLrw5f6g/jCInz52n9RTpropGgeAf/ioFUCdtsjCqu4gNhW9D01rUQBROoRjdzyn2Q==
dependencies:
use-sync-external-store "1.2.2"
zustand@^5.0.0-rc.2:
version "5.0.0-rc.2"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-5.0.0-rc.2.tgz#d28d95ffb6f0b20cadbaea39210f18446a5bf989"
integrity sha512-o2Nwuvnk8vQBX7CcHL8WfFkZNJdxB/VKeWw0tNglw8p4cypsZ3tRT7rTRTDNeUPFS0qaMBRSKe+fVwL5xpcE3A==

0 comments on commit dd6cc91

Please sign in to comment.