Skip to content

Commit

Permalink
fix: 메인페이지 카테고리 지도 레이아웃 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Songhyejeong committed Nov 25, 2024
1 parent d22bbe4 commit e5ea554
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 54 deletions.
13 changes: 12 additions & 1 deletion src/components/common/store/StoreList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ const StoreList = () => {
setOrderByRating(null);
};

if (isLoading) return <Loading />;
if (isLoading)
return (
<LoadingContainer>
<Loading />
</LoadingContainer>
);
return (
<StoreListLayout>
<FilteringContentsContainer>
Expand Down Expand Up @@ -295,3 +300,9 @@ const Alert = styled.h3`
font-size: 15px;
color: ${Orange};
`;

const LoadingContainer = styled.div`
@media screen and (max-width: 450px) {
margin-right: 90px;
}
`;
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import styled from 'styled-components';
import { Category } from '../common';
import { Category, MyMap } from '../common';
import { Grey } from '../../color';
import { ReactComponent as CategoryIcon } from '../../assets/Icon/main/CategoryIcon.svg';

const CategoryContainer = () => {
const CategoryAndMap = () => {
return (
<CategoryLayout>
<CategoryAndMapLayout>
<label>
<CategoryIcon />
<h3>카테고리로 검색하기</h3>
</label>
<CategoryBox>
<CategoryAndMapBox>
<div>
<Category />
</div>
</CategoryBox>
</CategoryLayout>
<div>
<MyMap />
</div>
</CategoryAndMapBox>
</CategoryAndMapLayout>
);
};

export default CategoryContainer;
export default CategoryAndMap;

const CategoryLayout = styled.div`
const CategoryAndMapLayout = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
Expand All @@ -41,11 +44,11 @@ const CategoryLayout = styled.div`
}
`;

const CategoryBox = styled.div`
const CategoryAndMapBox = styled.div`
display: flex;
justify-content: center;
flex-direction: row;
gap: 10px;
gap: 50px;
& > div {
width: 50%;
Expand Down
35 changes: 0 additions & 35 deletions src/components/main/MapContainer.jsx

This file was deleted.

7 changes: 4 additions & 3 deletions src/components/main/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import TopRecommendations from './TopRecommendations';
import CategoryContainer from './CategoryContainer';
import CategoryContainer from './CategoryAndMap';
import SearchKeyword from './SearchKeyword';
import MapContainer from './MapContainer';
export { TopRecommendations, CategoryContainer, SearchKeyword, MapContainer };
import CategoryAndMap from './CategoryAndMap';

export { TopRecommendations, CategoryContainer, SearchKeyword, CategoryAndMap };
9 changes: 6 additions & 3 deletions src/pages/MainPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { ReactComponent as Banner } from '../assets/Icon/banner/Banner.svg';
import { useIsFetch, useSaveBookmarkId } from '../store';
import { CategoryContainer, SearchKeyword, TopRecommendations, MapContainer } from '../components/main';
import { CategoryAndMap, SearchKeyword, TopRecommendations } from '../components/main';
import { SearchBar, Button, Footer } from '../components/common';
import { getBookmarksStores } from '../apis/api/bookmarks';

Expand Down Expand Up @@ -95,8 +95,7 @@ const MainPage = () => {
<SearchKeyword />
<Button color="green" text="식당 찾아 보기" visible="true" onClickHandler={buttonClickHandler} />
<TopRecommendations />
<CategoryContainer />
<MapContainer />
<CategoryAndMap />
</MainPageLayout>
<Footer />
</>
Expand Down Expand Up @@ -125,4 +124,8 @@ const SearchBarContainer = styled.div`
@media screen and (max-width: 1024px) {
width: 80%;
}
@media screen and (max-width: 500px) {
display: none;
}
`;
3 changes: 1 addition & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ import StoreDetailPage from './StoreDetailPage';
import SignUpPage from './SignUpPage';
import LoginPage from './LoginPage';
import NotFoundPage from './NotFoundPage';
import MapContainer from '../components/main/MapContainer';
export { MainPage, WebMap, SignUpPage, LoginPage, StoreDetailPage, NotFoundPage, MapContainer };
export { MainPage, WebMap, SignUpPage, LoginPage, StoreDetailPage, NotFoundPage };

0 comments on commit e5ea554

Please sign in to comment.