Skip to content

Commit 6231abe

Browse files
authored
Merge pull request #290 from boostcampwm-2024/dev-front
[FE] Merge to main
2 parents 3824863 + 6a80d02 commit 6231abe

File tree

6 files changed

+61
-11
lines changed

6 files changed

+61
-11
lines changed

frontend/src/boundary/CustomErrorFallback.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Loading from '@component/atom/Loading';
21
import { useQueryErrorResetBoundary } from '@tanstack/react-query';
32

43
type Props = {
@@ -15,7 +14,7 @@ export default function CustomErrorFallback({ resetErrorBoundary }: Props) {
1514

1615
return (
1716
<div className='flex flex-col items-center justify-center gap-4'>
18-
<Loading />
17+
<h1 className='text-black dark:text-white'>요청이 만료됐습니다. 재시도해주세요</h1>
1918
<button
2019
onClick={handleClickReset}
2120
className='flex items-center gap-2 rounded-lg bg-blue px-6 py-2 text-white shadow-md transition-all duration-200 hover:bg-opacity-90 hover:text-black active:scale-95'>

frontend/src/chart/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 여기는 📊chart 디렉토리입니다
2+
3+
공통으로 차트들을 모아놓은 디렉토리 입니다.
4+
option을 다르게해, Chart컴포넌트를 호출하는식으로 사용합니다.
5+
6+
구현방법
7+
8+
```ts
9+
export default function BarChart({ series, options: additionalOptions }: Props) {
10+
const barChartOptions: ApexCharts.ApexOptions = {
11+
chart: {
12+
height: '100%',
13+
type: 'bar'
14+
},
15+
};
16+
const options = merge({}, barChartOptions, additionalOptions);
17+
return <Chart type='bar' series={series} options={options} />;
18+
};
19+
```
20+
21+
- 차트종류에 맞게 파스칼케이스로 함수명을 짓습니다.
22+
- series는 차트에 표시할 데이터입니다.
23+
- options은 차트의 옵션입니다.
24+
- 차트의 옵션은 차트종류에 맞게 기본옵션을 정의하고, 추가옵션을 받아서 merge를 통해 합쳐서 사용합니다.
25+
- Chart컴포넌트를 호출할때 type, series, options를 넘겨줍니다.

frontend/src/component/molecule/NavbarRanking.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function NavbarRanking() {
4040
) : (
4141
<Fragment>
4242
<Span
43-
cssOption='w-5 h-5 flex-shrink-0 font-medium dark:text-white'
43+
cssOption='text-[1vw] flex-shrink-0 font-medium dark:text-white'
4444
content={`${rank + 1}th`}
4545
/>
4646
<P cssOption='truncate dark:text-white max-w-[140px]' content={item.projectName} />

frontend/src/component/organism/ProjectTrafficChart.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import DataLayout from '@component/template/DataLayout';
44
import { DATE_OPTIONS } from '@constant/Date';
55
import useProjectTraffic from '@hook/api/useProjectTraffic';
66
import { DateType } from '@type/Date';
7-
import { Link } from 'lucide-react';
87
import { useState } from 'react';
98

109
type Props = {
@@ -135,14 +134,9 @@ export default function ProjectTrafficChart({ id }: Props) {
135134
<DataLayout cssOption='flex flex-col p-[8px] rounded-lg shadow-md w-full h-full'>
136135
<div className='mb-[8px] flex items-center justify-between'>
137136
<div className='flex-1 items-center pl-12 pt-2 text-xl text-gray'>Total: {data.total}</div>
138-
<a
139-
className='mr-2 inline-flex items-center gap-1 text-2xl font-bold hover:text-blue'
140-
href={`http://${data.domain}`}
141-
target='_blank'
142-
rel='noreferrer'>
143-
<Link className='h-5 w-5' />
137+
<div className='mr-2 inline-flex items-center gap-1 text-2xl font-bold'>
144138
{data.projectName}
145-
</a>
139+
</div>
146140
<div className='flex justify-center'>Traffic Chart</div>
147141
<div className='flex flex-1 justify-end p-4'>
148142
<Select

frontend/src/router/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 여기는 🔃router 디렉토리입니다
2+
3+
라우팅 관련 컴포넌트를 모아놓은 디렉토리 입니다.
4+
5+
구현방법
6+
7+
```ts
8+
export default createBrowserRouter([
9+
{
10+
path: '/',
11+
element: <MainPage />
12+
},
13+
]);
14+
```
15+
16+
- path는 라우팅 경로입니다.
17+
- element는 해당 경로에 렌더링할 컴포넌트입니다.

frontend/src/store/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 여기는 🧳store 디렉토리입니다
2+
3+
스토어관련 코드를 모아놓은 디렉토리입니다.
4+
Zustand라이브러리를 사용해 스토어를 구현합니다.
5+
6+
구현방법
7+
8+
```ts
9+
const useNavbarStore = create<NavbarState>((set) => ({
10+
generation: GENERATION_VALUE.NINTH,
11+
setGeneration: (generation) => set({ generation })
12+
}));
13+
```
14+
15+
- 커스텀훅 규칙처럼 이름을 짓고, 마지막에 Store를 붙여줍니다.

0 commit comments

Comments
 (0)