Skip to content

Commit

Permalink
style. 스타일 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyu-dev committed Jan 10, 2024
1 parent 607eb61 commit 472a760
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 49 deletions.
1 change: 1 addition & 0 deletions src/components/templates/HomeTemplate/Plan/Plan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/components/templates/HomeTemplate/Styled.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HeadHeight } from '@utils/constants';
import styled from 'styled-components';

export const Wrap = styled.div`
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/components/templates/HomeTemplate/Week/WeekTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}, []);

// 등록하기 모달 띄우기
Expand Down Expand Up @@ -139,6 +138,7 @@ export const WeekTemplate = memo(() => {
<ListWrap style={{ height: `${listHeight}px` }}>
{!!planData?.length ? (
<FixedSizeList
className="scroll"
width="100%"
height={listHeight}
itemSize={120}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PlanModalTemplate } from '@components/templates/PlanModalTemplate';
import { Alert } from '@utils/Alert';
import { convertError } from '@utils/errors';
import { AxiosError } from 'axios';
import { useEffect, useMemo, useState } from 'react';
import { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import styled from 'styled-components';

Expand All @@ -18,16 +18,6 @@ export const MyEncyclopediaTemplate = () => {
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<any, TResponseCollection[]>({
Expand Down Expand Up @@ -62,7 +52,7 @@ export const MyEncyclopediaTemplate = () => {
return (
<Wrap>
<Spacing height={30} />
<StyledUl className="hidden-scroll" style={listHeight}>
<StyledUl className="hidden-scroll">
{collections?.map((collection, index) => (
<li key={index} onClick={handleClick(collection)}>
{collection.characterId === null ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const BookTitle = styled.h2`
font-size: 14px;
font-weight: 700;
color: black;
line-height: 16px;
display: -webkit-box;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -76,6 +75,7 @@ export const MyLibraryTemplate = () => {
<Spacing height={30} />
{!!bookList.length ? (
<FixedSizeList
className="scroll"
height={listHeight}
itemSize={142}
width="100%"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IconArrRightGray } from '@/assets';
import { setAccessToken } from '@/store/reducers';
import { Alert, convertError } from '@/utils';
import { Alert, FootHeight, HeadHeight, convertError } from '@/utils';
import { axiosFetch } from '@api/axios';
import { PlanModalTemplate } from '@components/templates/PlanModalTemplate';
import { AxiosError } from 'axios';
Expand Down Expand Up @@ -35,10 +35,8 @@ export const MyMenu = () => {
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` };
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}, []);

// 플랜 복구 시
Expand Down Expand Up @@ -95,6 +94,7 @@ export const MyRestoreTemplate = () => {
<Spacing height={30} />
{!!restoreList.length ? (
<FixedSizeList
className="scroll"
height={listHeight}
itemSize={105}
width="100%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const FlexBox = styled.div<{ $justifyContent?: string }>`
font-size: 16px;
font-weight: 700;
color: #000000;
line-height: 18px;
display: -webkit-box;
overflow: hidden;
Expand Down
1 change: 1 addition & 0 deletions src/components/templates/SearchTemplate/Book/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const BookTitle = styled.h2`
font-size: 14px;
font-weight: 700;
color: black;
line-height: 16px;
display: -webkit-box;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(
Expand Down Expand Up @@ -67,6 +66,7 @@ export const SearchMain = () => {
<Spacing height={18} />
{!!topBookList.length ? (
<FixedSizeList
className="hidden-scroll"
itemSize={142}
width="100%"
height={listHeight}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { TBookData } from '@components/templates/SearchTemplate/Book/Book';
import { TFormValue } from '@components/templates/SearchTemplate/SearchTemplate';
import { useGetSearchList } from '@components/templates/SearchTemplate/hooks';
import { Alert } from '@utils/Alert';
import { FootHeight, HeadHeight } from '@utils/constants';
import { memo, useCallback, useEffect, useMemo } from 'react';
import { useFormContext } from 'react-hook-form';
import { useDispatch, useSelector } from 'react-redux';
Expand Down Expand Up @@ -59,10 +60,8 @@ export const SearchResult = memo(() => {
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 () => {
Expand Down Expand Up @@ -103,6 +102,7 @@ export const SearchResult = memo(() => {
</CheckList>
{!!bookList.length ? (
<FixedSizeList
className="scroll"
ref={listRef}
height={listHeight}
itemSize={142}
Expand Down
3 changes: 2 additions & 1 deletion src/components/templates/SearchTemplate/Styled.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HeadHeight } from '@utils/constants';
import styled from 'styled-components';

export const Wrap = styled.form`
Expand All @@ -13,7 +14,7 @@ export const Wrap = styled.form`
export const Head = styled.section`
position: relative;
width: 100%;
flex: 0 0 85px;
flex: 0 0 ${`${HeadHeight}px`};
padding: 0 13px;
display: flex;
Expand Down
8 changes: 6 additions & 2 deletions src/styles/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

/* 달력 요일 개별 */
.react-calendar__month-view__weekdays__weekday {
flex: 1 !important;
min-width: 30px;
flex: 1 0 14% !important;
width: 100%;
min-height: 30px;

display: flex;
Expand All @@ -50,3 +50,7 @@ abbr {
.react-calendar__month-view__days__day div {
flex: 0 0 30px !important;
}

button.react-calendar__tile {
flex: 1 0 13% !important;
}
69 changes: 55 additions & 14 deletions src/styles/global-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@ export const GlobalStyle = createGlobalStyle`
height: 100%;
background: white;
overflow-y: auto;
box-sizing: border-box;
// iOS 11.0 버전
padding-top: constant(safe-area-inset-top);
padding-right: constant(safe-area-inset-right);
padding-bottom: constant(safe-area-inset-bottom);
padding-left: constant(safe-area-inset-left);
// iOS 11.2 이상
padding-top: env(safe-area-inset-top);
padding-right: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
padding-left: env(safe-area-inset-left);
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
Expand All @@ -35,21 +46,51 @@ export const GlobalStyle = createGlobalStyle`
height: 100% !important;
}
*::-webkit-scrollbar {
width: 5px;
height: 5px;
background-color: transparent;
}
*::-webkit-scrollbar-thumb {
width: 5px;
height: 5px;
background-color: #00000080;
border-radius: 2px;
.scroll {
scrollbar-width: thin;
&::-webkit-scrollbar {
width: 5px;
height: 5px;
background-color: transparent;
}
&::-webkit-scrollbar-thumb {
width: 5px;
height: 5px;
background-color: #00000080;
border-radius: 2px;
}
*::-webkit-scrollbar {
width: 5px;
height: 5px;
background-color: transparent;
}
*::-webkit-scrollbar-thumb {
width: 5px;
height: 5px;
background-color: #00000080;
border-radius: 2px;
}
* {
scrollbar-width: thin;
}
}
.hidden-scroll::-webkit-scrollbar, .hidden-scroll *::-webkit-scrollbar {
display: none;
.hidden-scroll {
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
*::-webkit-scrollbar {
display: none;
}
}
.active {
Expand Down

0 comments on commit 472a760

Please sign in to comment.