Skip to content

Commit 38a81e5

Browse files
authored
Merge pull request #259 from boostcampwm-2024/dev-front
[FE] Merge to main
2 parents 72c1105 + 18e132e commit 38a81e5

39 files changed

+337
-330
lines changed

frontend/src/App.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
import MobileLayout from '@component/template/MobileLayout';
2+
import useIsMobile from '@hook/useIsMobile';
13
import router from '@router/Router';
24
import { RouterProvider } from 'react-router-dom';
35

46
export default function App() {
5-
return <RouterProvider router={router} />;
7+
const isMobile = useIsMobile();
8+
9+
return (
10+
<>
11+
{isMobile && <MobileLayout />}
12+
<RouterProvider router={router} />
13+
</>
14+
);
615
}

frontend/src/boundary/CustomErrorBoundary.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import CustomErrorFallback from '@boundary/CustomErrorFallback';
12
import Loading from '@component/atom/Loading';
23
import { QueryErrorResetBoundary } from '@tanstack/react-query';
34
import { Suspense } from 'react';
45
import { ErrorBoundary } from 'react-error-boundary';
56

6-
import CustomErrorFallback from './CustomErrorFallback';
7-
87
type Props = {
98
children: React.ReactNode;
109
};

frontend/src/chart/PolarAreaChart.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export default function PolarAreaChart({ series, options: additionalOptions }: P
1111
const PolarChartOption: ApexCharts.ApexOptions = {
1212
chart: {
1313
type: 'polarArea',
14-
height: 300
14+
height: '100%',
15+
width: '100%',
16+
redrawOnParentResize: true,
17+
redrawOnWindowResize: true
1518
},
1619
plotOptions: {
1720
polarArea: {

frontend/src/component/atom/Loading.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export default function Loading() {
22
return (
33
<div className='flex items-center justify-center gap-4 bg-opacity-75 p-4 text-center'>
44
<div className='relative inline-flex'>
5-
<div className='absolute h-12 w-12 rounded-full border-1.5 border-gray' />
6-
<div className='h-24 w-24 animate-spin rounded-31 border-1.5 border-solid border-gray/30 border-t-gray [animation-duration:1.5s]' />
5+
<div className='absolute h-[12px] w-[12px] rounded-full border-[1.5px] border-gray' />
6+
<div className='h-[24px] w-[24px] animate-spin rounded-[31px] border-[1.5px] border-solid border-gray/30 border-t-gray [animation-duration:1.5s]' />
77
</div>
88
<span className='text-lg font-medium text-gray'>Loading...</span>
99
</div>

frontend/src/component/molecule/NavbarContact.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { Link } from 'react-router-dom';
66

77
export default function NavbarContact() {
88
return (
9-
<div className='flex items-center gap-2'>
9+
<div className='flex w-[100%] items-center gap-2'>
1010
<Link to={PATH.GITHUB} target='_blank' className='flex-shrink-0'>
11-
<Img src={GithubImg} alt='깃허브 이미지' cssOption='w-24 h-24 dark:invert' />
11+
<Img src={GithubImg} alt='깃허브 이미지' cssOption='w-[24px] h-[24px] dark:invert' />
1212
</Link>
1313
<P
14-
cssOption='text-10 flex items-center whitespace-nowrap text-gray'
14+
cssOption='text-[0.6vw] flex items-center whitespace-nowrap truncate text-gray'
1515
content='Contact us : [email protected]'
1616
/>
1717
</div>

frontend/src/component/molecule/NavbarMenu.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function NavbarMenu() {
1212
return (
1313
<Link to={item.path}>
1414
<div
15-
className={`flex cursor-pointer items-center gap-4 md:gap-8 ${
15+
className={`flex cursor-pointer items-center gap-4 md:gap-[8px] ${
1616
isActive
1717
? 'dark:text-white dark:hover:text-white'
1818
: 'text-gray hover:text-black dark:hover:text-white'
@@ -22,15 +22,18 @@ export default function NavbarMenu() {
2222
alt={`${item.label} 아이콘`}
2323
cssOption='w-4 md:w-6'
2424
/>
25-
<P content={item.label} cssOption='text-12 md:text-14 whitespace-nowrap' />
25+
<P content={item.label} cssOption='text-[1vw] trunacte' />
2626
</div>
2727
</Link>
2828
);
2929
}
3030

3131
return (
32-
<div className='flex flex-col gap-8 md:gap-16'>
33-
<H1 cssOption='mt-8 text-14 md:text-16 whitespace-nowrap dark:text-white' content='MENU' />
32+
<div className='flex flex-col gap-[8px] md:gap-[16px]'>
33+
<H1
34+
cssOption='mt-[8px] text-[14px] md:text-16 whitespace-nowrap dark:text-white'
35+
content='MENU'
36+
/>
3437
{MENU_ITEMS.map((item) => (
3538
<MenuItem
3639
key={item.path}

frontend/src/component/molecule/NavbarRanking.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export default function NavbarRanking() {
6161
};
6262

6363
return (
64-
<div className='mt-8 rounded-10 border-1.5 border-solid border-gray p-4'>
65-
<P cssOption='text-12 mb-1 font-bold dark:text-white' content='TRAFFIC RANKING' />
64+
<div className='mt-[8px] rounded-[10px] border-[1.5px] border-solid border-gray p-4'>
65+
<P cssOption='text-[0.9vw] mb-1 font-bold dark:text-white' content='TRAFFIC RANKING' />
6666
{data.rank.map((item, index) => renderRankingItem(item, index))}
6767
</div>
6868
);

frontend/src/component/molecule/NavbarSelect.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export default function NavbarSelect({ groupOption }: Props) {
1919
};
2020

2121
return (
22-
<div className='flex w-full min-w-0 items-center justify-between rounded-1.5 border-1.5 border-solid border-gray p-4 md:gap-[4px] md:p-8'>
22+
<div className='flex w-full min-w-0 items-center justify-between rounded-[1.5px] border-[1.5px] border-solid border-gray p-4 md:gap-[4px] md:p-[8px]'>
2323
{isProjectPath && (
2424
<Select
25-
cssOption='text-12 md:text-14 md:px-2 text-ellipsis cursor-pointer hover:font-semibold truncate dark:text-white'
25+
cssOption='text-[12px] md:text-[14px] md:px-2 text-ellipsis cursor-pointer hover:font-semibold truncate dark:text-white'
2626
options={GENERATION_OPTION}
2727
value={generation}
2828
onChange={setGeneration}
2929
/>
3030
)}
3131
<Select
32-
cssOption='text-12 md:text-14 md:px-2 text-ellipsis cursor-pointer text-gray hover:font-semibold truncate flex-1'
32+
cssOption='text-[12px] md:text-[14px] md:px-2 text-ellipsis cursor-pointer text-gray hover:font-semibold truncate flex-1'
3333
options={groupOption}
3434
value={selectedGroup}
3535
onChange={handleSelect}

frontend/src/component/molecule/NavbarTitle.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import FaviconImg from '@asset/image/Favicon.svg';
12
import H1 from '@component/atom/H1';
2-
import P from '@component/atom/P';
3+
import Img from '@component/atom/Img';
34
import { useNavigate } from 'react-router-dom';
45

56
export default function NavbarTitle() {
@@ -14,11 +15,8 @@ export default function NavbarTitle() {
1415
<div
1516
className='flex min-w-0 cursor-pointer items-center gap-2 md:gap-4'
1617
onClick={navigateMain}>
17-
<P cssOption='text-16 md:text-20 lg:text-24 shrink-0' content='🐥' />
18-
<H1
19-
cssOption='font-bold text-16 md:text-20 lg:text-24 truncate dark:text-white'
20-
content='WatchDucks'
21-
/>
18+
<Img src={FaviconImg} cssOption='w-[36px]' alt='와치덕스 로고 이미지' />
19+
<H1 cssOption='font-bold text-[1.6vw] truncate dark:text-white' content='WatchDucks' />
2220
</div>
2321
</div>
2422
);

frontend/src/component/molecule/ProjectElapsedTimeLegend.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export default function ProjectElapsedTimeLegend({ averageTime }: Props) {
1616
return (
1717
<div className='flex flex-col items-center gap-4'>
1818
<div className='text-center'>
19-
<H2 cssOption='text-navy mb-4 text-xl font-bold' content='TOP3 Average Response Speed' />
20-
<div className='mb-4 text-2xl font-bold' style={{ color: getColorByTime(averageTime) }}>
19+
<H2 cssOption='text-navy mb-4 text-[1vw] font-bold' content='TOP3 Average Response Speed' />
20+
<div className='mb-4 text-[2vw] font-bold' style={{ color: getColorByTime(averageTime) }}>
2121
{averageTime || 0}ms
2222
</div>
2323
</div>

0 commit comments

Comments
 (0)