Skip to content

Commit

Permalink
refactor: z-index 상수화하기
Browse files Browse the repository at this point in the history
  • Loading branch information
chlwlstlf committed Nov 15, 2024
1 parent e07f41c commit 4de4145
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 25 deletions.
3 changes: 2 additions & 1 deletion frontend/src/components/common/calendar/Calendar.style.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import styled from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

export const CalendarContainer = styled.section`
position: absolute;
z-index: 999;
z-index: ${Z_INDEX.dropdown};
width: 400px;
padding: 2rem;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/common/dropdown/Dropdown.style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { keyframes } from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

const dropdown = keyframes`
0% {
Expand Down Expand Up @@ -37,7 +38,7 @@ export const DropdownToggle = styled.button<{ $error: boolean }>`

export const DropdownMenu = styled.div`
position: absolute;
z-index: 1;
z-index: ${Z_INDEX.dropdown};
right: 0;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { keyframes } from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

const dropdown = keyframes`
0% {
Expand All @@ -17,7 +18,7 @@ export const ProfileContainer = styled.div`

export const DropdownMenu = styled.div`
position: absolute;
z-index: 1;
z-index: ${Z_INDEX.dropdown};
right: 0;
display: flex;
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/common/loading/Loading.style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { keyframes } from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

const moveUpDown = keyframes`
0% {
Expand All @@ -19,7 +20,7 @@ export const LoadingContainer = styled.div`
svg {
position: absolute;
z-index: 1001;
z-index: ${Z_INDEX.loading};
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
Expand All @@ -32,7 +33,7 @@ export const LoadingContainer = styled.div`

export const BackDrop = styled.div`
position: fixed;
z-index: 1000;
z-index: ${Z_INDEX.loadingBackdrop};
top: 0;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

//TimeDropdown
export const TimeDropdownContainer = styled.section`
Expand All @@ -24,7 +25,7 @@ export const TimeDropdownToggle = styled.input<{ $error: boolean }>`
//TimePicker
export const TimePickerWrapper = styled.div`
position: absolute;
z-index: 999;
z-index: ${Z_INDEX.dropdown};
display: flex;
gap: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const Overlay = styled.div`
pointer-events: auto;
position: absolute;
z-index: 10;
top: 60px;
left: 0;
Expand Down
28 changes: 14 additions & 14 deletions frontend/src/components/feedback/feedbackCard/FeedbackCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,6 @@ const FeedbackCard = ({
<S.ScreenReader>미션의 상세 피드백 내용입니다.</S.ScreenReader>

<S.FeedbackCardContainer $isTypeDevelop={feedbackType === "develop"}>
{!feedbackCardData.isWrited && (
<S.Overlay>
<S.ButtonWrapper>
<p>상대방 피드백을 작성해야 볼 수 있습니다.</p>
<Button
variant={feedbackType === "develop" ? "primary" : "secondary"}
onClick={handleNavigateUserFeedbackPage}
>
피드백 작성하러가기
</Button>
</S.ButtonWrapper>
</S.Overlay>
)}

<S.FeedbackHeader>
<HoverStyledLink to={`/profile/${feedbackCardData.username}`} tabIndex={-1}>
<S.FeedbackProfile>
Expand Down Expand Up @@ -142,6 +128,20 @@ const FeedbackCard = ({
</S.ButtonWrapper>
)}
</S.FeedbackContent>

{!feedbackCardData.isWrited && (
<S.Overlay>
<S.ButtonWrapper>
<p>상대방 피드백을 작성해야 볼 수 있습니다.</p>
<Button
variant={feedbackType === "develop" ? "primary" : "secondary"}
onClick={handleNavigateUserFeedbackPage}
>
피드백 작성하러가기
</Button>
</S.ButtonWrapper>
</S.Overlay>
)}
</S.FeedbackCardContainer>
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled, { keyframes } from "styled-components";
import { Z_INDEX } from "@/styles/zIndex";

const dropdown = keyframes`
0% {
Expand Down Expand Up @@ -35,7 +36,7 @@ export const IconWrapper = styled.div<{ $isOpen: boolean }>`

export const DropdownMenu = styled.div`
position: absolute;
z-index: 1;
z-index: ${Z_INDEX.dropdown};
right: 0;
display: flex;
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/callback/CallbackPage.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const LoadingContainer = styled.div`
border-radius: 25px;
p {
z-index: 999;
font: ${({ theme }) => theme.TEXT.medium_bold};
color: ${({ theme }) => theme.COLOR.grey4};
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/callback/CallbackPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const CallbackPage = () => {
<S.CallbackPageContainer>
<S.Character src={thinkingCharacter} alt="로그인 중" />
<S.LoadingContainer>
<p>로그인 중...</p>
<S.LoadingBar />
<p>로그인 중...</p>
</S.LoadingContainer>
</S.CallbackPageContainer>
);
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/intro/IntroPage.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import media from "@/styles/media";
// 헤더
export const HeaderContainer = styled.header`
position: fixed;
z-index: 100;
top: 0;
left: 20px;
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/styles/zIndex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const Z_INDEX = {
base: 0,
dropdown: 100,
modalBackdrop: 200,
modal: 300,
tooltip: 400,
toast: 500,
loadingBackdrop: 900,
loading: 1000,
};

0 comments on commit 4de4145

Please sign in to comment.