Skip to content

Commit

Permalink
refactor : 그라디언트와 물결 컴포넌트로 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
kangminguu committed Jan 1, 2025
1 parent 17a264d commit 5058003
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 45 deletions.
30 changes: 2 additions & 28 deletions public/물결.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/components/Common/GradientContainer/GradientContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** 그라디언트 배경을 주는 container */
export const GradientContainer = () => {
const gradientStyle = {
background:
'linear-gradient(to top, #58A1EB 0%, #91CFF8 50%, #C6E6FC 100%)'
};

return (
<div
className="h-full max-w-[473px] min-w-[375px] w-full absolute"
style={gradientStyle}
></div>
);
};
2 changes: 1 addition & 1 deletion src/components/Common/NavigationBar/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const NavigationBar = () => {
];

return (
<nav className="flex justify-around bg-white border-y p-3 max-w-[473px] min-w-[375px] w-full z-[9999]">
<nav className="flex justify-around bg-white border-y p-3 max-w-[475px] min-w-[375px] w-full z-[9999]">
{navItems.map((item) => (
<div className="flex justify-center flex-1" key={item.id}>
<NavigationItem
Expand Down
8 changes: 8 additions & 0 deletions src/components/Common/WaveContainer/WaveContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const WaveContainer = () => {
return (
<div className="z-0">
<img src="/무인도.svg" className="absolute -top-10 right-20" />
<div className="bg-[url('/물결.svg')] absolute h-full w-full overflow-auto bg-cover bg-center custom-mask" />
</div>
);
};
4 changes: 2 additions & 2 deletions src/components/HomePage/LetterContainer/LetterContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { EffectCards } from 'swiper/modules';
import 'swiper/swiper-bundle.css';
import { NotificationBadge } from '../../Common/NotificationBadge/NotificationBadge';
import { HomeBottleLetter } from '../HomeBottleLetter';
import { WaveContainer } from '@/components/Common/WaveContainer/WaveContainer';

type RecommendLetter = {
letterId: number;
Expand All @@ -25,8 +26,7 @@ type LetterContainerProps = {
export const LetterContainer = ({ letters }: LetterContainerProps) => {
const hasLetters = (
<div className="relative -m-6 pb-10">
<img src="/무인도.svg" className="absolute -top-10 right-20" />
<div className="bg-[url('/물결.svg')] absolute h-full w-full overflow-auto bg-cover bg-center custom-mask"></div>
<WaveContainer />

<div className="absolute right-[80px] z-[2]">
<NotificationBadge count={letters.length} />
Expand Down
8 changes: 5 additions & 3 deletions src/pages/Home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ToggleVariant } from '@/constants/toggleVariant';
import { useGetThreeLetterData } from '@/hooks/useGetThreeLetterData';
import { ErrorPage } from '../ErrorPage';
import { usePushNotifications } from '@/hooks/usePushNotifications';
import { Margin } from '@/components/Common/Margin/Margin';

export const HomePage = () => {
usePushNotifications(); // 푸시 알림 훅
Expand All @@ -31,8 +32,8 @@ export const HomePage = () => {
}

return (
<div className="relative h-full overflow-auto px-6 py-6 flex flex-col justify-between gap-5 scrollbar-hide">
<div>
<div className="relative h-full w-full flex flex-col justify-between gap-5 ">
<div className="z-0">
<TopButtonContainer />

<Toggle
Expand Down Expand Up @@ -64,8 +65,9 @@ export const HomePage = () => {
</div>
</div>

<div className="relative -mx-6">
<div className="relative -mx-5">
<BannerContainer />
<Margin bottom={20} />
</div>

<SliderMenuContainer
Expand Down
Loading

0 comments on commit 5058003

Please sign in to comment.