File tree 6 files changed +61
-11
lines changed
6 files changed +61
-11
lines changed Original file line number Diff line number Diff line change 1
- import Loading from '@component/atom/Loading' ;
2
1
import { useQueryErrorResetBoundary } from '@tanstack/react-query' ;
3
2
4
3
type Props = {
@@ -15,7 +14,7 @@ export default function CustomErrorFallback({ resetErrorBoundary }: Props) {
15
14
16
15
return (
17
16
< div className = 'flex flex-col items-center justify-center gap-4' >
18
- < Loading / >
17
+ < h1 className = 'text-black dark:text-white' > 요청이 만료됐습니다. 재시도해주세요 </ h1 >
19
18
< button
20
19
onClick = { handleClickReset }
21
20
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' >
Original file line number Diff line number Diff line change
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를 넘겨줍니다.
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export default function NavbarRanking() {
40
40
) : (
41
41
< Fragment >
42
42
< 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'
44
44
content = { `${ rank + 1 } th` }
45
45
/>
46
46
< P cssOption = 'truncate dark:text-white max-w-[140px]' content = { item . projectName } />
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import DataLayout from '@component/template/DataLayout';
4
4
import { DATE_OPTIONS } from '@constant/Date' ;
5
5
import useProjectTraffic from '@hook/api/useProjectTraffic' ;
6
6
import { DateType } from '@type/Date' ;
7
- import { Link } from 'lucide-react' ;
8
7
import { useState } from 'react' ;
9
8
10
9
type Props = {
@@ -135,14 +134,9 @@ export default function ProjectTrafficChart({ id }: Props) {
135
134
< DataLayout cssOption = 'flex flex-col p-[8px] rounded-lg shadow-md w-full h-full' >
136
135
< div className = 'mb-[8px] flex items-center justify-between' >
137
136
< 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' >
144
138
{ data . projectName }
145
- </ a >
139
+ </ div >
146
140
< div className = 'flex justify-center' > Traffic Chart</ div >
147
141
< div className = 'flex flex-1 justify-end p-4' >
148
142
< Select
Original file line number Diff line number Diff line change
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는 해당 경로에 렌더링할 컴포넌트입니다.
Original file line number Diff line number Diff line change
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를 붙여줍니다.
You can’t perform that action at this time.
0 commit comments