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

CSS scroll-snap 모드에서 카페가 한 번에 한 개씩 스와이프되도록 설정 #581

Merged
merged 4 commits into from
Oct 12, 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
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ const Container = styled.div`

& > * {
scroll-snap-align: start;
scroll-snap-stop: always;
}
`;
22 changes: 20 additions & 2 deletions client/src/pages/CafeMapPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { Status, Wrapper } from '@googlemaps/react-wrapper';
import { type ReactElement } from 'react';
import styled from 'styled-components';
import CafeMap from '../components/CafeMap';
import LoadingBar from '../components/LoadingBar';
import AppError from '../errors/AppError';

const render = (status: Status): ReactElement => {
if (status === Status.FAILURE) return <div>에러입니다.</div>;
return <div>로딩중...</div>;
if (status === Status.FAILURE) {
throw new AppError('지도를 불러오는데 실패하였습니다. 잠시 후 다시 시도해주세요');
}
return (
<Container>
<LoadingBar />
</Container>
);
};

const CafeMapPage = () => {
Expand All @@ -16,3 +25,12 @@ const CafeMapPage = () => {
};

export default CafeMapPage;

const Container = styled.div`
display: flex;
align-items: center;
justify-content: center;

width: 100%;
height: 100%;
`;
Loading