Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] 검색 페이지 코드 리팩터링 #121

Merged
merged 20 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1a35998
feat : favicon 수정
gominzip Jun 9, 2024
f7b8d60
chore : 로그인 안내문구 변경
gominzip Jun 9, 2024
96ef577
chore: 스타일 코드 디렉토리 및 파일 분리(#120)
rbgksqkr Jun 17, 2024
9f50ac5
refactor: 삼항연산자로 복잡한 JSX 반환하는 컴포넌트 구조 개선(#120)
rbgksqkr Jun 18, 2024
4c5934d
fix: 같은 검색결과 반환값을 캐싱하도록 queryKey 수정(#120)
rbgksqkr Jun 18, 2024
5d2fe97
chore: 사용처에서 네이밍을 변경하도록 수정(#120)
rbgksqkr Jun 18, 2024
881e47c
refactor: 불필요한 리렌더링 개선(#120)
rbgksqkr Jun 18, 2024
29e86cf
chore: react-query 중복 설치 제거(#120)
rbgksqkr Jun 18, 2024
62fdf91
refactor: useSuspenseQuery와 Suspense를 활용하여 로딩 UI 처리(#120)
rbgksqkr Jun 18, 2024
6e0b709
fix: searchKeyword가 빈 문자열일 때 API 호출을 막기 위해 Promise 반환(#120)
rbgksqkr Jun 18, 2024
1575188
refactor: 자동완성창 외부 클릭시 창닫기 로직을 id 대신 ref 를 활용하여 수정(#120)
rbgksqkr Jun 19, 2024
83088d2
refactor: 자동완성창 관리하는 로직을 useFocusSearchInput 커스텀 훅으로 분리하고 불필요한 form 형…
rbgksqkr Jun 19, 2024
057f234
refactor: 불필요한 file deps를 제거하고, params를 각각의 컴포넌트에서 읽도록 수정(#120)
rbgksqkr Jun 19, 2024
e8dfa5e
feat: 검색 API 호출 시, 검색 페이지 입력값과 Navbar 입력값 동기화하기(#120)
rbgksqkr Jun 19, 2024
bfd5361
chore: form 태그 제거로 인해 파일명 변경(#120)
rbgksqkr Jun 19, 2024
98d45cb
refactor: 검색어와 100% 일치하는 데이터가 있는 경우 라우팅하는 커스텀 훅 분리(#120)
rbgksqkr Jun 19, 2024
a897c57
chore: 파일명 수정(#120)
rbgksqkr Jun 19, 2024
b7d9a4e
fix: 문서 페이지로 이동해도 Navbar 입력값 유지(#120)
rbgksqkr Jun 19, 2024
46b8946
design: 검색 화면 반응형 디자인 수정(#120)
rbgksqkr Jun 19, 2024
2ff5eea
chore: 중복되는 css 제거(#120)
rbgksqkr Jun 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 2 additions & 92 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"react-icons": "^4.12.0",
"react-markdown": "^9.0.1",
"react-markdown-editor-lite": "^1.3.4",
"react-query": "^3.39.3",
"react-quill": "^2.0.0",
"react-responsive": "^9.0.2",
"react-select": "^5.8.0",
Expand Down
1 change: 1 addition & 0 deletions src/apis/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getSearchResult = async (keyword: string): Promise<ISearchResult |
};
return searchResultList;
}

return { kind: 'searchResult', data };
};

Expand Down
4 changes: 1 addition & 3 deletions src/apis/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ const baseURL = process.env.NEXT_PUBLIC_SERVER_URL;

// 특정 문서의 전체 편집 목록 불러오기
export const getDocHistories = async (title: string) => {
console.log(title);
try {
const response = await axios.get(`${baseURL}history/${title}/`);
return response.data;
} catch (error) {
console.log(error);
return false;
console.error(error);
}
};
116 changes: 60 additions & 56 deletions src/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'Pretendard';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Light.woff') format('woff');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: 'Pretendard';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'Pretendard';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-SemiBold.woff') format('woff');
font-weight: 600;
font-style: normal;
}

@font-face {
font-family: 'Pretendard';
src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/[email protected]/Pretendard-Bold.woff') format('woff');
Expand All @@ -30,75 +34,75 @@
}

html {
-webkit-text-size-adjust​: none;
width: 100%;
height: 100%;
margin: 0;
font-size: 62.5%;
overflow: scroll;
scroll-snap-type: y mandatory;
scroll-padding-top: 65px;
scrollbar-width: none;
-ms-overflow-style: none;
display: flex;
justify-content: center;
background: #4c4df5;
background-image: linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
background-size:
100px 100px,
100px 100px;
background-position:
-1px -1px,
-1px -1px;
-webkit-text-size-adjust​: none;
width: 100%;
height: 100%;
margin: 0;
font-size: 62.5%;
overflow: scroll;
scroll-snap-type: y mandatory;
scroll-padding-top: 65px;
scrollbar-width: none;
-ms-overflow-style: none;
display: flex;
justify-content: center;
background: #4c4df5;
background-image: linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
background-size:
100px 100px,
100px 100px;
background-position:
-1px -1px,
-1px -1px;
}

html::-webkit-scrollbar {
display: none;
display: none;
}

body {
width: 100%;
height: fit-content;
/* 화면 스크롤 방지를 위해 최소높이 지정 */
min-height: 100%;
margin: 0;
padding: 0;
/* 드래그 방지 */
/* -webkit-user-select: none;
width: 100%;
height: fit-content;
/* 화면 스크롤 방지를 위해 최소높이 지정 */
min-height: 100%;
margin: 0;
padding: 0;
/* 드래그 방지 */
/* -webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; */
}
}

@media (min-width:0px) {
html {
font-size: 8px;
}
@media (min-width:0px) {
html {
font-size: 8px;
}
}

/* 타블렛) 화면 너비: 576 ~ */
@media (min-width:576px) {
html {
font-size: 10px;
}
/* 타블렛) 화면 너비: 768 ~ */
@media (min-width: 768px) {
html {
font-size: 10px;
}
}

/* 데스크톱) 화면 너비: 1024 ~ */
@media (min-width: 1024px) {
html {
font-size: 10px;
}
/* 데스크톱) 화면 너비: 1024 ~ */
@media (min-width: 1024px) {
html {
font-size: 10px;
}
}

img {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
}
img {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
}
4 changes: 1 addition & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export const metadata: Metadata = {
authors: [{ name: '중하하 2기' }],
creator: '중하하 2기',
publisher: '중하하 2기',
icons: {
icon: '/img/icon.png',
},
keywords: ['중앙대학교', '멋쟁이 사자처럼', '멋사', '멋사 위키', '중앙대학교 멋사'],
openGraph: {
title: '멋사 중앙대 위키',
Expand All @@ -33,6 +30,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<html>
<head>
<link rel="manifest" href="/manifest.json" />
<link rel="icon" href="/img/icon.png" type="image/png" sizes="32x32" />
</head>
<body>
<RecoidContextProvider>
Expand Down
Loading