diff --git a/src/components/templates/HomeTemplate/Plan/Plan.tsx b/src/components/templates/HomeTemplate/Plan/Plan.tsx index c8a76b5..874deb1 100644 --- a/src/components/templates/HomeTemplate/Plan/Plan.tsx +++ b/src/components/templates/HomeTemplate/Plan/Plan.tsx @@ -169,6 +169,7 @@ const FlexBox = styled.div<{ $justifyContent?: string }>` font-size: 16px; font-weight: 700; color: #000000; + line-height: 18px; text-align: left; display: -webkit-box; diff --git a/src/components/templates/HomeTemplate/Styled.tsx b/src/components/templates/HomeTemplate/Styled.tsx index ada8814..8f31375 100644 --- a/src/components/templates/HomeTemplate/Styled.tsx +++ b/src/components/templates/HomeTemplate/Styled.tsx @@ -1,3 +1,4 @@ +import { HeadHeight } from '@utils/constants'; import styled from 'styled-components'; export const Wrap = styled.div` @@ -12,7 +13,7 @@ export const Wrap = styled.div` export const Head = styled.section` position: relative; width: 100%; - flex: 0 0 85px; + flex: 0 0 ${`${HeadHeight}px`}; display: flex; flex-direction: column; diff --git a/src/components/templates/HomeTemplate/Week/WeekTemplate.tsx b/src/components/templates/HomeTemplate/Week/WeekTemplate.tsx index 0b11ced..2089eee 100644 --- a/src/components/templates/HomeTemplate/Week/WeekTemplate.tsx +++ b/src/components/templates/HomeTemplate/Week/WeekTemplate.tsx @@ -10,6 +10,7 @@ import { PlanModalTemplate } from '@components/templates/PlanModalTemplate'; import { usePlanValidation } from '@hooks/planValidation'; import { colors } from '@style/global-style'; import { Alert } from '@utils/Alert'; +import { FootHeight, HeadHeight } from '@utils/constants'; import { convertError } from '@utils/errors'; import { AxiosError } from 'axios'; import dayjs from 'dayjs'; @@ -70,10 +71,8 @@ export const WeekTemplate = memo(() => { const listHeight = useMemo(() => { const doc = document.querySelector('#root') as HTMLElement; const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; const bodyHeight = 307; - return scrollHeight - (headerHeight + footerHeight + bodyHeight); + return scrollHeight - (HeadHeight + FootHeight + bodyHeight); }, []); // 등록하기 모달 띄우기 @@ -139,6 +138,7 @@ export const WeekTemplate = memo(() => { {!!planData?.length ? ( { const dispatch = useDispatch(); const [isOpen, setIsOpen] = useState(false); - const listHeight = useMemo(() => { - const doc = document.querySelector('#root') as HTMLElement; - const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; - const bodyHeight = 30; - const height = scrollHeight - (headerHeight + footerHeight + bodyHeight); - return { height: `${height}px` }; - }, []); - const getEncyList = async () => { try { const res = await axiosFetch({ @@ -62,7 +52,7 @@ export const MyEncyclopediaTemplate = () => { return ( - + {collections?.map((collection, index) => (
  • {collection.characterId === null ? ( diff --git a/src/components/templates/MyPageTemplate/MyLibraryTemplate/Book.tsx b/src/components/templates/MyPageTemplate/MyLibraryTemplate/Book.tsx index e449b93..5f61560 100644 --- a/src/components/templates/MyPageTemplate/MyLibraryTemplate/Book.tsx +++ b/src/components/templates/MyPageTemplate/MyLibraryTemplate/Book.tsx @@ -111,6 +111,7 @@ const BookTitle = styled.h2` font-size: 14px; font-weight: 700; color: black; + line-height: 16px; display: -webkit-box; overflow: hidden; diff --git a/src/components/templates/MyPageTemplate/MyLibraryTemplate/MyLibraryTemplate.tsx b/src/components/templates/MyPageTemplate/MyLibraryTemplate/MyLibraryTemplate.tsx index 1afccbd..3aaa808 100644 --- a/src/components/templates/MyPageTemplate/MyLibraryTemplate/MyLibraryTemplate.tsx +++ b/src/components/templates/MyPageTemplate/MyLibraryTemplate/MyLibraryTemplate.tsx @@ -3,6 +3,7 @@ import { TSearchBooksResult } from '@api/types'; import { Spacing } from '@components/common/Spacing'; import { Book } from '@components/templates/MyPageTemplate/MyLibraryTemplate/Book'; import { Alert } from '@utils/Alert'; +import { FootHeight, HeadHeight } from '@utils/constants'; import { convertError } from '@utils/errors'; import { AxiosError } from 'axios'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; @@ -32,10 +33,8 @@ export const MyLibraryTemplate = () => { const listHeight = useMemo(() => { const doc = document.querySelector('#root') as HTMLElement; const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; const bodyHeight = 30; - return scrollHeight - (headerHeight + footerHeight + bodyHeight); + return scrollHeight - (HeadHeight + FootHeight + bodyHeight); }, []); const getPlanList = async (page: number) => { @@ -76,6 +75,7 @@ export const MyLibraryTemplate = () => { {!!bookList.length ? ( { const listHeight = useMemo(() => { const doc = document.querySelector('#root') as HTMLElement; const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; const bodyHeight = 95; - const height = scrollHeight - (headerHeight + footerHeight + bodyHeight); + const height = scrollHeight - (HeadHeight + FootHeight + bodyHeight); return { height: `${height}px` }; }, []); diff --git a/src/components/templates/MyPageTemplate/MyRestoreTemplate/MyRestoreTemplate.tsx b/src/components/templates/MyPageTemplate/MyRestoreTemplate/MyRestoreTemplate.tsx index 47e2d26..6a02734 100644 --- a/src/components/templates/MyPageTemplate/MyRestoreTemplate/MyRestoreTemplate.tsx +++ b/src/components/templates/MyPageTemplate/MyRestoreTemplate/MyRestoreTemplate.tsx @@ -5,6 +5,7 @@ import { RestoreBook } from '@components/templates/MyPageTemplate/MyRestoreTempl import { PlanModalTemplate } from '@components/templates/PlanModalTemplate'; import { usePlanValidation } from '@hooks/planValidation'; import { Alert } from '@utils/Alert'; +import { FootHeight, HeadHeight } from '@utils/constants'; import { convertError } from '@utils/errors'; import { AxiosError } from 'axios'; import dayjs from 'dayjs'; @@ -50,10 +51,8 @@ export const MyRestoreTemplate = () => { const listHeight = useMemo(() => { const doc = document.querySelector('#root') as HTMLElement; const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; const bodyHeight = 30; - return scrollHeight - (headerHeight + footerHeight + bodyHeight); + return scrollHeight - (HeadHeight + FootHeight + bodyHeight); }, []); // 플랜 복구 시 @@ -95,6 +94,7 @@ export const MyRestoreTemplate = () => { {!!restoreList.length ? ( ` font-size: 16px; font-weight: 700; color: #000000; + line-height: 18px; display: -webkit-box; overflow: hidden; diff --git a/src/components/templates/SearchTemplate/Book/Book.tsx b/src/components/templates/SearchTemplate/Book/Book.tsx index 5b06185..0bec8bd 100644 --- a/src/components/templates/SearchTemplate/Book/Book.tsx +++ b/src/components/templates/SearchTemplate/Book/Book.tsx @@ -124,6 +124,7 @@ const BookTitle = styled.h2` font-size: 14px; font-weight: 700; color: black; + line-height: 16px; display: -webkit-box; overflow: hidden; diff --git a/src/components/templates/SearchTemplate/SearchMain/SearchMain.tsx b/src/components/templates/SearchTemplate/SearchMain/SearchMain.tsx index 4372c29..229f86f 100644 --- a/src/components/templates/SearchTemplate/SearchMain/SearchMain.tsx +++ b/src/components/templates/SearchTemplate/SearchMain/SearchMain.tsx @@ -4,6 +4,7 @@ import { Spacing } from '@components/common/Spacing'; import { DisplayAds } from '@components/connections'; import { Book } from '@components/templates/SearchTemplate/Book'; import { Alert } from '@utils/Alert'; +import { FootHeight, HeadHeight } from '@utils/constants'; import { convertError } from '@utils/errors'; import { AxiosError } from 'axios'; import { useEffect, useMemo, useState } from 'react'; @@ -15,10 +16,8 @@ export const SearchMain = () => { const listHeight = useMemo(() => { const doc = document.querySelector('#root') as HTMLElement; const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; const bodyHeight = 20 + 66 + 18 + 23 + 18; - return scrollHeight - (headerHeight + footerHeight + bodyHeight); + return scrollHeight - (HeadHeight + FootHeight + bodyHeight); }, []); const itemData = useMemo( @@ -67,6 +66,7 @@ export const SearchMain = () => { {!!topBookList.length ? ( { const listHeight = useMemo(() => { const doc = document.querySelector('#root') as HTMLElement; const scrollHeight = doc.scrollHeight; - const headerHeight = 85; - const footerHeight = 70; const bodyHeight = 20 + 30 + 20; - return scrollHeight - (headerHeight + footerHeight + bodyHeight); + return scrollHeight - (HeadHeight + FootHeight + bodyHeight); }, []); const getNextPage = useCallback(async () => { @@ -103,6 +102,7 @@ export const SearchResult = memo(() => { {!!bookList.length ? (