Skip to content

Commit

Permalink
style : 배너 스타일 깨짐 수정 (#393)
Browse files Browse the repository at this point in the history
* style : 스크롤 깨짐 수정

* style : 레이아웃 수정

* style : 지도편지 작성 페이지 스타일 수정

* style : 배너 스타일 수정
  • Loading branch information
cmlim0070 authored Dec 9, 2024
1 parent 7bab79f commit 18930a6
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const BackButtonCotainer = () => {
};

return (
<div className="w-full flex flex-row justify-start">
<div className="w-full flex flex-row justify-start sticky top-0 z-10 pb-[15px]">
<BackButton onClick={handleBackClick} />
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type BannerProps = {
export const Banner = ({ color, children }: BannerProps) => {
return (
<div
className={`flex h-[150px] rounded-lg overflow-hidden shadow transition-all ${color}`}
className={`flex overflow-hidden rounded-lg shadow transition-all ${color}`}
>
{children}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ContainerProps {
export const Container: React.FC<ContainerProps> = ({ px = 0, children }) => {
return (
<div
className={`px-${px} py-6 w-full h-full overflow-auto scrollbar-hide`}
className={`relative flex flex-col px-${px} pt-3 py-6 w-full h-full`}
>
{children}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/MapPage/Maplibre/MaplibreWithSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const MaplibreWithSearch = ({

return (
<div className="relative h-screen">
<TopBar handleBackClick={onBackClick} />
<div className="absolute z-10 flex items-center p-2 space-x-2 transform -translate-x-1/2 bg-white rounded-lg shadow-md top-10 left-1/2">
{/* <TopBar handleBackClick={onBackClick} /> */}
<div className="absolute z-10 flex items-center p-2 space-x-2 transform -translate-x-1/2 bg-white rounded-lg shadow-md top-[1rem] left-1/2">
<input
type="text"
value={searchText}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const NavigateContainer: React.FC<NavigateContainerProps> = ({
count
}) => {
return (
<div className="flex-center bg-gray-200 rounded-2xl shadow-md w-[300px] p-2">
<p className="text-lg font-bold text-gray-700 ">
<div className="flex-center bg-sample-blue rounded-2xl shadow-md w-[300px] p-2">
<p className="text-lg font-bold text-white ">
반경 500m 내 {count}
</p>
</div>
Expand Down
17 changes: 10 additions & 7 deletions src/pages/Map/MapExplorerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useSearchStore } from '@/stores/useSearchStore';
import { formatDate } from '@/util/formatDate';
import { calculateDaysLeft } from '@/util/calculateDaysLeft';
import { formatDistance } from '@/util/formatDistance';
import { BackButtonCotainer } from '@/components/Common/BackButtonContainer/BackButtonCotainer';

export const MapExplorerPage = () => {
const { searchedLocation } = useSearchStore();
Expand Down Expand Up @@ -51,6 +52,8 @@ export const MapExplorerPage = () => {
setQuery(event.target.value);
};

const CreateBtnStyle = `text-sample-blue absolute gap-2 p-2 transform -translate-x-12 flex-center bottom-[5rem] translate-y-7 left-[46%] bg-white border border-sample-blue w-52 rounded-2xl`;

return (
<div>
<div className="relative">
Expand All @@ -76,23 +79,23 @@ export const MapExplorerPage = () => {
</div>
)}
</div>
<div className="absolute transform -translate-x-1/2 bottom-20 left-1/2">
<div className="absolute transform -translate-x-1/2 bottom-[6rem] left-1/2">
{!isSearchFocused && (
<>
{selectedLetter ? (
<>
{searchedLocation ? (
<NavLink
to={`/letter/map/:${searchedLocation.lat}/:${searchedLocation.lon}/create`}
className="absolute gap-2 p-2 transform -translate-x-12 flex-center bottom-60 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
to={'/letter/create'}
className={CreateBtnStyle}
>
<HiOutlinePencilAlt />
지도 편지 작성하기
</NavLink>
) : (
<NavLink
to={'/letter/create'}
className="absolute gap-2 p-2 transform -translate-x-12 cursor-not-allowed flex-center bottom-60 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
className={CreateBtnStyle}
onClick={(e) => e.preventDefault()}
>
<HiOutlinePencilAlt />
Expand All @@ -114,16 +117,16 @@ export const MapExplorerPage = () => {
<>
{searchedLocation ? (
<NavLink
to={`/letter/map/:${searchedLocation.lat}/:${searchedLocation.lon}/create`}
className="absolute gap-2 p-2 transform -translate-x-12 flex-center bottom-24 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
to={'/letter/create'}
className={CreateBtnStyle}
>
<HiOutlinePencilAlt />
지도 편지 작성하기
</NavLink>
) : (
<NavLink
to={'/letter/create'}
className="absolute gap-2 p-2 transform -translate-x-12 cursor-not-allowed flex-center bottom-24 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
className={CreateBtnStyle}
onClick={(e) => e.preventDefault()}
>
<HiOutlinePencilAlt />
Expand Down
53 changes: 28 additions & 25 deletions src/pages/Storage/StoragePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,36 @@ export const StoragePage = ({ initialType }: StoragePageProps) => {
const [storageType, setStorageType] = useState<storageType>(initialType);

return (
<div className="">
<div className="relative flex w-full overflow-hidden text-md align-middle h-[50px] text-sample-black">
<div
className="absolute bottom-0 w-1/3 h-[2px] transition-transform duration-500 ease-in-out bg-sample-blue"
style={{
transform: `translateX(${getTranslateX(storageType)})`
}}
></div>
<div
className="flex items-center justify-center flex-1 h-full cursor-pointer"
onClick={() => setStorageType('keyword')}
>
<span>키워드 편지</span>
</div>
<div
className="flex items-center justify-center flex-1 h-full cursor-pointer"
onClick={() => setStorageType('map')}
>
<span>내 지도 편지</span>
</div>
<div
className="flex items-center justify-center flex-1 h-full cursor-pointer"
onClick={() => setStorageType('bookmark')}
>
<span>보관한 지도 편지</span>
<div className="flex flex-col h-full">
<div className="sticky top-0 bg-white z-10">
<div className="relative flex w-full overflow-hidden text-md align-middle h-[50px] text-sample-black ">
<div
className="absolute bottom-0 w-1/3 h-[2px] transition-transform duration-500 ease-in-out bg-sample-blue"
style={{
transform: `translateX(${getTranslateX(storageType)})`
}}
></div>
<div
className="flex items-center justify-center flex-1 h-full cursor-pointer"
onClick={() => setStorageType('keyword')}
>
<span>키워드 편지</span>
</div>
<div
className="flex items-center justify-center flex-1 h-full cursor-pointer"
onClick={() => setStorageType('map')}
>
<span>내 지도 편지</span>
</div>
<div
className="flex items-center justify-center flex-1 h-full cursor-pointer"
onClick={() => setStorageType('bookmark')}
>
<span>보관한 지도 편지</span>
</div>
</div>
</div>

<div className="flex flex-col gap-2 mt-[15px]">
<StorageList type={storageType} />
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/User/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AccountInfoSection } from '@/components/Profile/AccountInfoSection';
import { NicknameSection } from '@/components/Profile/NicknameSection';
import { ProfileImageSection } from '@/components/Profile/ProfileImageSection';
import { useState } from 'react';
import { BackButtonCotainer } from '@/components/Common/BackButtonContainer/BackButtonCotainer';

export const ProfilePage = () => {
const navigate = useNavigate();
Expand All @@ -17,6 +18,7 @@ export const ProfilePage = () => {

return (
<div className="flex flex-col gap-10">
<BackButtonCotainer />
<div className="flex flex-col items-center justify-center gap-5 ">
<ProfileImageSection
isEditing={isProfileImageEditing}
Expand Down
37 changes: 22 additions & 15 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ const AuthLayout = () => (
</div>
);

const MapLayout = () => (
<div>
<Outlet />
<NavigationBar />
</div>
);

export const router = createBrowserRouter([
{
path: '/',
Expand Down Expand Up @@ -137,21 +144,6 @@ export const router = createBrowserRouter([
}
]
},
{
path: '/',
element: (
<ProtectedRoute>
<SimpleLayout />
</ProtectedRoute>
),
errorElement: <ErrorPage />,
children: [
{
path: '/mapexplorer',
element: <MapExplorerPage />
}
]
},
{
path: '/letter',
element: (
Expand Down Expand Up @@ -186,6 +178,21 @@ export const router = createBrowserRouter([
}
]
},
{
path: '/',
element: (
<PublicRoute>
<MapLayout />
</PublicRoute>
),
errorElement: <ErrorPage />,
children: [
{
path: '/mapexplorer',
element: <MapExplorerPage />
}
]
},
{
path: '/',
element: (
Expand Down

0 comments on commit 18930a6

Please sign in to comment.