Skip to content

Commit

Permalink
feat: (#740) 알림 컨테이너 외부 크기에 맞추어 style 조정
Browse files Browse the repository at this point in the history
- 사이드바에서 높이 설정
- 툴팁에서는 최대높이 및 가로길이 설정
  • Loading branch information
chsua committed Oct 14, 2023
1 parent b7d603b commit 7019429
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/common/WideHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MouseEvent, useRef } from 'react';
import { CSSProperties, MouseEvent, useRef } from 'react';
import { useNavigate } from 'react-router-dom';

import { useToggle } from '@hooks';
Expand All @@ -13,6 +13,12 @@ import ToolTip from '../ToolTip';

import * as S from './style';

// 70px = 토글 스위치의 크기(40px) 및 상하 padding(각 10px), gap(10px)
const alarmToolTipStyle: CSSProperties = {
maxHeight: '600px',
width: '450px',
};

export default function WideHeader() {
const navigate = useNavigate();
const { isOpen, openComponent, closeComponent } = useToggle();
Expand Down Expand Up @@ -44,7 +50,7 @@ export default function WideHeader() {
{isOpen && (
<S.ToolTipBackdrop onClick={handleToolTipClick} ref={toolTipRef}>
<ToolTip size="free">
<AlarmContainer closeToolTip={closeComponent} />
<AlarmContainer closeToolTip={closeComponent} style={alarmToolTipStyle} />
</ToolTip>
</S.ToolTipBackdrop>
)}
Expand Down
11 changes: 8 additions & 3 deletions frontend/src/pages/HomePage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Suspense } from 'react';
import { CSSProperties, Suspense } from 'react';

import { useToggle } from '@hooks';

Expand All @@ -25,6 +25,11 @@ import { smoothScrollToTop } from '@utils/scrollToTop';

import * as S from './style';

// 70px = 토글 스위치의 크기(40px) 및 상하 padding(각 10px), gap(10px)
const alarmDrawerStyle: CSSProperties = {
height: 'calc(100vh - 70px)',
};

export default function HomePage() {
const {
drawerRef: categoryDrawerRdf,
Expand Down Expand Up @@ -71,10 +76,10 @@ export default function HomePage() {
<Drawer
handleDrawerClose={closeAlarmDrawer}
placement="right"
width="225px"
width="310px"
ref={alarmDrawerRef}
>
<AlarmContainer closeToolTip={closeAlarmDrawer} />
<AlarmContainer closeToolTip={closeAlarmDrawer} style={alarmDrawerStyle} />
</Drawer>
</S.DrawerWrapper>
<ErrorBoundary>
Expand Down

0 comments on commit 7019429

Please sign in to comment.