Skip to content

Commit f41e75b

Browse files
authored
Revert "[Feat] 디자인 수정 및 api 수정 (#72)" (#73)
This reverts commit 3cf6a05.
1 parent 3cf6a05 commit f41e75b

19 files changed

Lines changed: 101 additions & 148 deletions

File tree

src/assets/images/map/map1.png

-333 KB
Loading

src/assets/images/map/map2.png

-333 KB
Loading

src/assets/images/map/map3.png

-332 KB
Loading

src/assets/images/map/map4.png

-331 KB
Loading

src/components/bottom-sheet/BottomSheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ const BottomSheet: React.FC<{ setIsModalOpen: (isOpen: boolean) => void }> = ({
308308
</div>
309309
<div className="flex flex-col mt-4 h-2 w-full rounded-lg gap-1 text-body-sb bg-gray-200 text-black relative">
310310
<div
311-
className="absolute top-0 left-0 h-full bg-primary-font rounded-lg"
311+
className="absolute top-0 left-0 h-full bg-primary-font rounded-l-lg"
312312
style={{ width: `${percent}%` }}
313313
/>
314314
</div>

src/components/common/Toast.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function Toast({
2424

2525
return (
2626
<div
27-
className={`z-60 flex justify-between items-center fixed bottom-[10vh] left-1/2 max-w-[90vw] w-full -translate-x-1/2 rounded-sm text-black px-4 py-2 bg-white transition-all duration-300 ${
27+
className={`z-60 flex justify-between items-center fixed top-10 left-1/2 max-w-[90vw] w-full -translate-x-1/2 rounded-sm text-black px-4 py-2 bg-white transition-all duration-300 ${
2828
visible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-3"
2929
}`}
3030
>

src/components/home/Avatar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const Avatar = ({
8686
<div className="balloon-wrapper text-body-sb z-45">
8787
<>
8888
<div
89-
className={`balloon balloon-center text-body-sb gap-4 flex flex-col py-5 px-6 min-w-50 ${
89+
className={`balloon balloon-center text-body-sb gap-4 flex flex-col py-5 px-6 min-w-50 ${
9090
isAnswered
9191
? "bg-transparent after:border-transparent text-transparent"
9292
: "text-black bg-white after:border-l-transparent after:border-b-transparent after:border-r-transparent after:border-t-white"
@@ -105,9 +105,9 @@ const Avatar = ({
105105
<div
106106
className={`${
107107
isChecked > 0 ? "hidden" : "block"
108-
} text-black `}
108+
} text-black`}
109109
>
110-
<div className="pb-4">
110+
<div>
111111
오늘도 만나서 정말 반가워요!
112112
<br />
113113
괜찮으시다면 오늘 하루는 어떠셨는지
@@ -159,7 +159,7 @@ const Avatar = ({
159159
)}
160160
{isToastOpen2 && (
161161
<Toast
162-
message="물(오전 12시) 햇빛(오전 6시)에 초기화 됩니다."
162+
message="물 주기(오전 12시) 햇빛 주기(오전 6시)에 초기화 됩니다."
163163
onClose={isClose => setIsToastOpen2(isClose)}
164164
/>
165165
)}

src/components/home/BirdModal.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const BirdModal = ({ setIsOpen }: Props) => {
1414
return (
1515
<Modal setIsOpen={setIsOpen}>
1616
<img
17-
className="w-16 h-auto absolute bottom-45 left-0"
17+
className="w-12 h-auto absolute bottom-32 left-0"
1818
src={Bird}
1919
alt="bird"
2020
/>
@@ -37,16 +37,6 @@ const BirdModal = ({ setIsOpen }: Props) => {
3737
기록
3838
</div>
3939
</div>
40-
{isRecord && (
41-
<div className="text-body2 text-gray-400 text-center">
42-
아직 방문한 친구들이 없어요!
43-
</div>
44-
)}
45-
{!isRecord && (
46-
<div className="text-body2 text-gray-400 text-center">
47-
아직 기록이 없어요!
48-
</div>
49-
)}
5040
</Modal>
5141
);
5242
};

src/components/home/FirstPlant.tsx

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,36 @@ const FirstPlant = ({
3636

3737
const [isToastOpen, setIsToastOpen] = useState(false);
3838
const [isToastOpen2, setIsToastOpen2] = useState(false);
39-
const [isToastOpen3, setIsToastOpen3] = useState(false);
4039

4140
const [message, setMessage] = useState("");
4241

4342
const handleSunLight = async () => {
4443
// 이미 애니메이션 중이면 무시
4544
if (isSunLight) return;
4645
if (!isAbleSunLight) {
47-
setIsToastOpen3(true);
46+
setIsToastOpen2(true);
4847
return;
4948
}
5049
try {
5150
const res = await axios.post(
5251
`/api/v1/gardens/${garden?.gardenId}/sunlight`
5352
);
54-
if (res.status === 202) {
55-
setIsToastOpen3(true);
56-
return;
57-
} else {
58-
setIsSunLight(true);
59-
// 기존 타이머 클리어
60-
if (timerRef.current) {
61-
clearTimeout(timerRef.current);
62-
timerRef.current = null;
63-
}
64-
65-
// 1초 후 꺼지게
66-
timerRef.current = window.setTimeout(() => {
67-
setIsSunLight(false);
68-
timerRef.current = null;
69-
}, 1000);
70-
}
7153
console.log(res);
72-
54+
setIsSunLight(true);
7355
setIsAbleSunLight(false);
7456
setIsWater(false);
57+
58+
// 기존 타이머 클리어
59+
if (timerRef.current) {
60+
clearTimeout(timerRef.current);
61+
timerRef.current = null;
62+
}
63+
64+
// 1초 후 꺼지게
65+
timerRef.current = window.setTimeout(() => {
66+
setIsSunLight(false);
67+
timerRef.current = null;
68+
}, 1000);
7569
} catch (error) {
7670
if (error instanceof AxiosError) {
7771
setMessage(error.response?.data.message);
@@ -98,28 +92,20 @@ const FirstPlant = ({
9892
`/api/v1/gardens/${garden?.gardenId}/mywater`
9993
);
10094
console.log(res);
101-
setIsSunLight(false);
10295
setIsAbleWater(false);
103-
104-
if (res.status === 202) {
105-
setIsToastOpen2(true);
106-
return;
107-
} else {
108-
setIsAbleWater(false);
109-
setIsWater(true);
110-
111-
// 기존 타이머 클리어
112-
if (timerRef.current) {
113-
clearTimeout(timerRef.current);
114-
timerRef.current = null;
115-
}
116-
117-
// 1초 후 꺼지게
118-
timerRef.current = window.setTimeout(() => {
119-
setIsWater(false);
120-
timerRef.current = null;
121-
}, 1000);
96+
setIsWater(true);
97+
setIsSunLight(false);
98+
// 기존 타이머 클리어
99+
if (timerRef.current) {
100+
clearTimeout(timerRef.current);
101+
timerRef.current = null;
122102
}
103+
104+
// 1초 후 꺼지게
105+
timerRef.current = window.setTimeout(() => {
106+
setIsWater(false);
107+
timerRef.current = null;
108+
}, 1000);
123109
} catch (error) {
124110
if (error instanceof AxiosError) {
125111
setMessage(error.response?.data.message);
@@ -141,9 +127,9 @@ const FirstPlant = ({
141127
}}
142128
/>
143129

144-
<div className="relative z-20 flex h-full w-full flex-col items-center justify-center ">
130+
<div className="relative z-20 flex h-full w-full flex-col items-center justify-center">
145131
<header className="relative flex w-full items-center justify-between p-4 text-heading1 text-white">
146-
<Map isNumber={1} />
132+
<Map isNumber={3} />
147133
{garden?.avatar.avatarName}
148134
<div className="h-12 w-12" />
149135
</header>
@@ -183,16 +169,10 @@ const FirstPlant = ({
183169
)}
184170
{isToastOpen2 && (
185171
<Toast
186-
message="물 주기는 오전 12시에 초기화 됩니다"
172+
message="물 주기(오전 12시) 햇빛 주기(오전 6시)에 초기화 됩니다."
187173
onClose={() => setIsToastOpen2(false)}
188174
/>
189175
)}
190-
{isToastOpen3 && (
191-
<Toast
192-
message="햇빛 주기는 오전 6시에 초기화 됩니다"
193-
onClose={() => setIsToastOpen3(false)}
194-
/>
195-
)}
196176
{message && <Toast message={message} onClose={() => setMessage("")} />}
197177
</div>
198178
);

src/components/home/FourthPlant.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ const FourthPlant = ({
1919
isOpen: boolean;
2020
garden: GardenSummary | null;
2121
}) => {
22-
const [isUnlocked, setIsUnlocked] = useState<BottomSheetType>(
23-
garden?.locked ? "lock" : "unlock"
24-
);
22+
const [isUnlocked, setIsUnlocked] = useState<BottomSheetType>("lock");
2523
return (
2624
<div
2725
className="w-full h-full flex flex-col relative items-center justify-center bg-cover bg-center bg-no-repeat"
@@ -46,7 +44,6 @@ const FourthPlant = ({
4644
<button
4745
onClick={() => setIsUnlocked("unlock")}
4846
className={`m-4 text-white bg-gray-400 p-3 text-body2 rounded-lg`}
49-
disabled={garden?.locked}
5047
>
5148
충분하지 않아요
5249
</button>

0 commit comments

Comments
 (0)