diff --git a/src/App.css b/src/App.css
index 40a5043..2bcf9c7 100644
--- a/src/App.css
+++ b/src/App.css
@@ -1,3 +1,9 @@
+@import url('https://fonts.googleapis.com/css2?family=42dot+Sans:wght@300..800&family=Gowun+Batang&display=swap');
+
+body {
+ font-family: "42dot Sans", sans-serif;
+}
+
#root {
margin: 0 auto;
padding: 2rem;
diff --git a/src/index.css b/src/index.css
index 1da9c62..c6dd210 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,9 +1,11 @@
+@import url('https://fonts.googleapis.com/css2?family=42dot+Sans:wght@300..800&family=Gowun+Batang&display=swap');
+
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
+ font-family: "42dot Sans", Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
index 4070c7c..12f38c9 100644
--- a/src/pages/Home.jsx
+++ b/src/pages/Home.jsx
@@ -23,6 +23,7 @@ const Home = () => {
const [userInfo, setUserInfo] = useState({});
const [userLoading, setUserLoading] = useState(true);
const [userError, setUserError] = useState(null);
+ const [prevTier, setPrevTier] = useState(null);
const [loading, setLoading] = useState(true);
const [user, setUser] = useState(null);
@@ -38,6 +39,15 @@ const Home = () => {
const navigate = useNavigate();
const [client, setClient] = useState(null); // WebSocket 클라이언트 상태
+ // 티어 아이콘 매핑
+ const tierEmojis = {
+ NONE: "❌미획득",
+ SEED: "🫘씨앗",
+ SPROUT: "🌱새싹",
+ FLOWER: "🌺꽃",
+ FRUIT: "🍎열매",
+ TREE: "🌳나무",
+ };
// 사용자 정보 불러오기
useEffect(() => {
@@ -56,6 +66,33 @@ const Home = () => {
fetchUserInfo();
}, []);
+// 업적 기록을 가져오기
+const fetchTierInfo = async () => {
+ try {
+ const response = await fetch("/api/user/tierinfo");
+ const data = await response.json();
+
+ // "2025년 겨울 시즌" 데이터 필터링
+ const winterTier = data.find(item => item.year === "2025" && item.season === "winter");
+
+ if (winterTier) {
+ console.log("겨울 시즌 티어:", winterTier.tier);
+ setPrevTier(winterTier.tier); // 상태로 저장하여 UI에 반영
+ } else {
+ console.log("겨울 시즌 데이터 없음");
+ setPrevTier("미획득");
+ }
+ } catch (error) {
+ console.error("Tier 정보를 가져오는 중 오류 발생:", error);
+ }
+};
+
+// useEffect를 사용하여 API 호출
+useEffect(() => {
+ fetchTierInfo();
+}, []);
+
+
const toggleModal = async () => {
// 읽은 알림들을 필터링하여 제거
setNotifications(prev => prev.filter(noti => !noti.read));
@@ -366,8 +403,6 @@ useEffect(() => {
| 시즌 | +현재 시즌 (봄) | 총 커밋 | 공개 커밋 | 비공개 커밋 | @@ -429,19 +464,56 @@ useEffect(() => {|
|---|---|---|---|---|---|
|
+
+ {getSeasonIcon("spring")}
+ 봄 시즌
+
+ |
+ + {seasonData.spring.totalCommitContributions + seasonData.spring.restrictedContributionsCount} + | ++ {seasonData.spring.totalCommitContributions} + | ++ {seasonData.spring.restrictedContributionsCount} + | ++ 0 ? 'current-streak-badge' : 'zero-value'}`}> + {seasonData.spring.currentStreakDays}일 + + | ++ 0 ? 'max-streak-badge' : 'zero-value'}`}> + {seasonData.spring.maxStreakDays}일 + + | +
| 지난 시즌 | +총 커밋 | +공개 커밋 | +비공개 커밋 | +획득 티어 | +최장 연속 | +
|---|---|---|---|---|---|
| - {data.totalCommitContributions} + {seasonData[season].totalCommitContributions} | - {data.restrictedContributionsCount} + {seasonData[season].restrictedContributionsCount} | - 0 ? 'current-streak-badge' : 'zero-value'}`}> - {data.currentStreakDays}일 - + {season === "winter" ? ( + + {tierEmojis[prevTier] || tierEmojis['NONE']} + + ) : ( + + {tierEmojis['NONE']} + )} | - 0 ? 'max-streak-badge' : 'zero-value'}`}> - {data.maxStreakDays}일 + 0 ? 'max-streak-badge' : 'zero-value'}`}> + {seasonData[season].maxStreakDays}일 |