Skip to content

Commit 5bcf179

Browse files
manNomi한만욱
andauthored
refactor : home lcp 개선 (#208)
* fix : serverFetch 반환값이 더이상 error를 throw하지 않도록 수정했습니다 * refactor : home 페이지가 revalidate가 정상 작동하도록 수정했습니다 * refactor : 클라이언트 컴포넌트 분해했습니다 * refactor : home의 테일윈드 고정값 모두 수정했습니다 * refactor : 전체적인 홈페이지 개선했습니다 1. revalidate 작동하도록 isr로 수정했습니다 2. 컴포넌트 중 레거시 삭제 및 college -> university로 통일작업했습니다 3. 레거시 컴포넌트의 분리 및 테일윈드 값 PR 내용 반영하도록 했습니다 * refactor : 홈페이지의 추천 영역 react-query로 수정했습니다 * refactor : 레거시 삭제했습니다 * refactor : productuin 상태일때는 universities를 사용하도록 수정했습니다 * refactor : unoptimized 설정 삭제했습니다 * refactor : PR 내용 반영했습니다 * fix : 배포 서버 전 테스트용으로 endpoint 분가 수정했습니다 * refactor : 폰트 및 이미지 최적화 했습니다 --------- Co-authored-by: 한만욱 <manwook-han@hanman-ug-ui-MacBookPro.local>
1 parent 4666fc8 commit 5bcf179

5 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎src/api/university/client/useGetRecommendedUniversity.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ const getRecommendedUniversity = async ({
99
}: {
1010
queryKey: [string, boolean];
1111
}): Promise<RecommendedUniversityResponse> => {
12-
1312
const endpoint = process.env.NODE_ENV !== "development" ? "/univ-apply-infos/recommend" : "/universities/recommend";
1413

15-
1614
const [, isLogin] = queryKey;
1715
const instance = isLogin ? axiosInstance : publicAxiosInstance;
1816
const res = await instance.get(endpoint);

‎src/api/university/server/getRecommendedUniversity.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import serverFetch from "@/utils/serverFetchUtil";
33
import { RecommendedUniversityResponse } from "../type/response";
44

55
const getRecommendedUniversity = async () => {
6-
76
const endpoint = process.env.NODE_ENV !== "development" ? "/univ-apply-infos/recommend" : "/universities/recommend";
87

9-
108
const res = await serverFetch<RecommendedUniversityResponse>(endpoint, {
119
isAuth: false, // 인증이 필요 없는 API로 설정
1210
});

‎src/api/university/server/getSearchUniversityList.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ interface SearchParams {
2020
* - 필요 시 query string 을 동적으로 붙인다.
2121
*/
2222
const getSearchUniversityList = async ({ region, keyword, testType, testScore }: SearchParams = {}) => {
23-
2423
const endpoint = process.env.NODE_ENV !== "development" ? "/univ-apply-infos/search" : "/universities/search";
2524

26-
2725
const params = new URLSearchParams();
2826

2927
if (region) params.append("region", region);

‎src/app/_home/index.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ const Home = async () => {
8888
<a key={news.id} target="_blank" href={news.url} rel="noreferrer">
8989
<div className="flex gap-4">
9090
<Image
91+
loading="lazy"
92+
placeholder="blur"
9193
className="h-24 w-44 shrink-0 rounded-xl object-cover"
9294
src={news.imageUrl}
9395
alt={news.title}

‎src/app/layout.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const viewport: Viewport = {
4545

4646
const RootLayout = ({ children }: { children: React.ReactNode }) => (
4747
<AlertProvider>
48-
<html lang="ko" className="font-serif">
48+
<html lang="ko">
4949
<KakaoScriptLoader />
5050
<AppleScriptLoader />
5151
<GoogleAnalytics gaId="G-V1KLYZC1DS" />

0 commit comments

Comments
 (0)