Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 데스크탑 뷰 전환 후 UI 깨짐 해결 #501

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions frontend/.pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"react-router": "^6.14.2",
"react-router-dom": "^6.14.1",
"styled-normalize": "^8.0.7",
"zipgo-layout": "^0.3.0"
"zipgo-layout": "0.4.0"
},
"lint-staged": {
"**/*.{ts,tsx}": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { PropsWithChildren } from 'react';
import { styled } from 'styled-components';
import { DesktopView } from 'zipgo-layout';
import { DesktopView, useDesktopView } from 'zipgo-layout';

import BackgroundImg from '@/assets/svg/background_img.svg';
import ZipgoLogo from '@/assets/svg/zipgo_logo_light.svg';
import ZipgoTextLogo from '@/assets/svg/zipgo_text_logo.svg';
import theme from '@/styles/theme';

const RenderSub = () => (
<SupporterWrapper>
Expand All @@ -31,7 +32,11 @@ const MobileToDesktop = (props: DesktopViewProps) => {
const { children } = props;

return (
<DesktopView backgroundImage={BackgroundImg} renderSub={RenderSub()}>
<DesktopView
backgroundImage={BackgroundImg}
renderSub={RenderSub()}
maxWidth={theme.maxWidth.mobile}
>
{children}
</DesktopView>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const Layout = styled.div`
align-items: flex-start;

width: 100%;
max-width: ${({ theme }) => theme.maxWidth.mobile};
height: 57.4rem;

background: ${({ theme }) => theme.color.grey200};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ const PetSizeContainer = styled.div`
const ButtonContainer = styled.div`
position: fixed;
bottom: 4rem;
left: 0;

display: flex;
gap: 1.6rem;

width: 100%;
max-width: ${({ theme }) => theme.maxWidth.mobile};
padding: 0 2rem;
`;

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Review/ReviewForm/ReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const DetailReviewText = styled.textarea<{ $isValid: boolean }>`

width: 100%;
min-height: 12rem;
margin-bottom: 15rem;
padding: 1.2rem;

line-height: 2.4rem;
Expand All @@ -162,10 +163,11 @@ const SubmitButton = styled.button`

position: fixed;
bottom: 0;
left: 0;

width: 100%;
max-width: ${({ theme }) => theme.maxWidth.mobile};
height: 9rem;
margin-left: -2rem;

font-size: 2rem;
font-weight: 700;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ const ReviewList = () => {
</NoReviewContainer>
)}
{userInfo?.hasPet && (
<ReviewAddButton type="button" aria-label="리뷰 작성" onClick={goReviewWrite}>
<WriteIconImage src={WriteIcon} alt="" />
</ReviewAddButton>
<ButtonWrapper>
<ReviewAddButton type="button" aria-label="리뷰 작성" onClick={goReviewWrite}>
<WriteIconImage src={WriteIcon} alt="" />
</ReviewAddButton>
</ButtonWrapper>
)}
</Layout>
);
Expand Down Expand Up @@ -106,15 +108,21 @@ const NoReviewText = styled.p`
text-align: center;
`;

const ButtonWrapper = styled.div`
position: fixed;
bottom: 12rem;

width: 100%;
max-width: ${({ theme }) => theme.maxWidth.mobile};
padding: 1.6rem;
`;

const ReviewAddButton = styled.button`
all: unset;

cursor: pointer;

position: fixed;
right: 1.6rem;
bottom: 12rem;

float: right;
display: flex;
justify-content: center;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/FoodDetail/FoodDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const FoodDetail = () => {
export default FoodDetail;

const FoodDetailWrapper = styled.div`
padding: 4rem 0 12rem;
padding: 4rem 0 24rem;
`;

const FoodProfileContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ const Content = styled.div`
const SubmitButton = styled.button`
cursor: pointer;

position: fixed;
bottom: 4rem;
position: absolute;
bottom: 6rem;
left: 2rem;

width: calc(100% - 4rem);
max-width: ${({ theme }) => theme.maxWidth.mobile};
height: 5.1rem;

font-size: 1.6rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ const ErrorCaption = styled.p`
export const NextButton = styled.button`
cursor: pointer;

position: fixed;
bottom: 4rem;
position: absolute;
bottom: 6rem;
left: 2rem;

width: calc(100% - 4rem);
max-width: ${({ theme }) => theme.maxWidth.mobile};
height: 5.1rem;

font-size: 1.6rem;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/Review/ReviewAddition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ const Container = styled.div`
justify-content: center;

width: 100%;
height: 100vh;
padding: 2rem;
`;

const FoodInfoWrapper = styled.div`
width: 100%;
margin-top: 24rem;
margin-top: 4rem;
margin-bottom: 2.4rem;
padding: 2.4rem 0;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/globalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const globalStyle = css`
height: 0;
}
/* stylelint-disable-next-line media-feature-range-notation */
@media (max-width: 380px) {
@media (max-width: 392px) {
font-size: 50%;
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const color = {
} as const;

const maxWidth = {
mobile: '42rem',
mobile: '49rem',
} as const;

// 폰트
Expand Down
10 changes: 5 additions & 5 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9870,7 +9870,7 @@ __metadata:
webpack-cli: ^5.1.4
webpack-dev-server: ^4.15.1
webpack-merge: ^5.9.0
zipgo-layout: ^0.3.0
zipgo-layout: 0.4.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -18070,12 +18070,12 @@ __metadata:
languageName: node
linkType: hard

"zipgo-layout@npm:^0.3.0":
version: 0.3.0
resolution: "zipgo-layout@npm:0.3.0"
"zipgo-layout@npm:0.4.0":
version: 0.4.0
resolution: "zipgo-layout@npm:0.4.0"
dependencies:
react: ^18.2.0
styled-components: ^6.0.8
checksum: dc91581cd7ba0fa3aea340a9b381b228a6d6aaa7aca963482ba1fe54976d5684f143c07b3d16e4647b331f5027509a9c1a504b33fa481a078bddb7341e4a1fa7
checksum: 0a6852d01832c9d6c47d4e2ddbe0311108bebf3a8fc83eb39d78cae8f96a559f155cc11accd08ea81f1675ecd098b6932b72f1ea393d270b2bae9c41617e1eed
languageName: node
linkType: hard