-
Notifications
You must be signed in to change notification settings - Fork 1
온보딩 페이지 로직 변경: 디바이스 환경에 따른 이동 방식 수정 #120
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
온보딩 페이지 변경사항 확인했습니다! 꼼꼼하게 레퍼런스까지 찾아서 여러 디바이스 환경까지 고려해주신 부분이 멋집니다...!🥹👏👍 저는 이렇게 환경에 따라 다르게 ui를 구성해 본 경험이 없어서 이번에 질문이 좀 많네요... ㅜㅜ 고생 많으셨습니당!!! 👍
src/pages/onboarding/index.tsx
Outdated
import { Swiper, SwiperSlide } from 'swiper/react'; | ||
import { Navigation, Pagination } from 'swiper/modules'; | ||
import * as S from './index.style'; | ||
|
||
import 'swiper/css'; | ||
import 'swiper/css/navigation'; | ||
import 'swiper/css/pagination'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정말 정말 사소한 부분이긴 한데,, 혹시 swiper 관련 css import 하는 부분 위쪽에 빈 줄을 땨로 추가하신 것은 어떤 이유인가요...?
스타일 코드를 분리하기 위해서라기엔 16번째 줄에 index.style을 import하는 곳에는 따로 구분하는 부분이 없고, swiper 관련 파일들을 구분하기 위해서라기엔 Swiper 컴포넌트를 import하는 곳이랑은 분리되어 있어서 궁금했습니다 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swiper 관련 파일 import를 쉽게 확인하기 위해 띄워두었습니다! Swiper 컴포넌트도 같이 두고 싶었는데, 컴포넌트 import를 스타일 밑으로 두면 lint 에러가 나서 위에 따로 두었습니다.
그런데 생각해보니 다음처럼 index.style import를 가장 마지막에 두면 해결되더라구요! 꼼꼼하게 봐주셔서 감사합니당 🤗
import Header from '@/common/components/Header';
import Onboarding1 from '@/assets/pngs/Onboarding1.png';
/** swiper 관련 파일 */
import { Swiper, SwiperSlide } from 'swiper/react';
import { Navigation, Pagination } from 'swiper/modules';
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
import * as S from './index.style';
src/styles/globalStyles.ts
Outdated
.swiper { | ||
display: flex; | ||
max-width: 37.5rem; | ||
flex-direction: column; | ||
flex: 1; | ||
width: 100%; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swiper를 스타일링하는 부분이 전역 스타일로 지정되어 있는데,
아래처럼 styled를 이용해서 Swiper 컴포넌트를 스타일링 할 수 있어요!
만약에 전역으로 해 둘 특별한 이유가 없다면 온보딩 페이지에서 사용하는 코드들은 가까운 위치에 두면 나중에 코드 파악하기에 좋을 것 같아요!
import { Swiper } from 'swiper/react';
import styled from 'styled-components';
export const StyledSwiper = styled(Swiper)``; // 이름은 대충 지었습니다...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅎㅎ 주석이 너무 귀엽네요
넵 Swiper 컴포넌트를 extend하는 방식으로 수정하겠습니다! 다른 css 선택자들도 다음처럼 적용할 수 있을 것 같습니당
import styled from 'styled-components';
import { Swiper } from 'swiper/react';
export const CustomSwiper = styled(Swiper)`
.swiper-button-next,
.swiper-button-prev {
margin: 0 10px;
}
.swiper-pagination-bullet-active {
width: ${props => props.theme.unit[16]};
border-radius: ${props => props.theme.radius.default};
}
`;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경사항 확인했습니다!!!!!! 화면 너비 따라 잘 적용되네요 👏👏👏👏 수고 많으셨습니다~!! 👍👍
📝 관련 이슈
MOD-33
💻 작업 내용
1. 사용 환경에 따라 온보딩 페이지 이동 방식을 나누었습니다.
2. 온보딩 페이지에서의 swipe 이외의 추가 수정사항을 반영했습니다.
하단 버튼을 “시작하기” 버튼으로 수정하고, 해당 버튼 클릭 시 홈페이지로 이동하도록 바꿨습니다.
하단 버튼으로 기능이 옮겨져 더 이상 필요없는 상단 "건너뛰기" 버튼을 제거했습니다.
2, 3, 4번째 온보딩 페이지의 로티 이미지가 여러 화면 사이즈에서 같은 위치에 있도록 수정했습니다.
position: absolute;
width: 90%;
top: 70%;
// 중앙 정렬 코드
left: 50%;
transform: translate(-50%, -50%);
✅ 테스트 리스트 (선택)
📸 스크린샷
👻 리뷰 요구사항 (선택)