Skip to content

Commit 6cbdf14

Browse files
author
kdaon07
committed
img upload
1 parent 8832fe4 commit 6cbdf14

21 files changed

Lines changed: 172 additions & 12 deletions

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL=/api

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL=https://space-edu.org

src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const App = () => {
5252
<Route path="/" element={<LandingPage />} />
5353
<Route path="/join" element={<Join />} />
5454
<Route path="/login" element={<Login />} />
55-
<Route element={<PrivateRoute />}>
55+
{/* <Route element={<PrivateRoute />}> */}
5656
<Route path="/main" element={<Main />} />
5757
<Route path="/sea/:id" element={<Sea />} />
5858
<Route path="/volcano/:id" element={<Volcano />} />
@@ -66,7 +66,7 @@ const App = () => {
6666
<Route path="/admin/question" element={<Question />} />
6767
<Route path="/admin/incorrect" element={<Incorrect />} />
6868
<Route path="/admin/maximun" element={<Maximun />} />
69-
</Route>
69+
{/* </Route> */}
7070
</Routes>
7171
</Suspense>
7272
</ErrorBoundary>

src/Components/Simulator.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import { useState, useEffect } from "react";
22
import Stage from "./Stage";
33
import styled from "styled-components";
44

5-
export default function Simulator({array, img, title, direction}) {
5+
export default function Simulator({array, img, title, direction}) {
66
const [item, setItem] = useState([]);
77
useEffect(() => {
88
setItem(img);
99
console.log(direction);
1010
}, []);
11-
11+
12+
1213
return (
13-
<SimulBg>
14+
<SimulBg onClick={() => console.log(item)}>
1415
<Map>
1516
<tbody>
1617
{array.map((row, rowIndex) => (

src/Page/LandingPage/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ export default function LandingPage({ setMainLogin }) {
3535
},
3636
withCredentials: true,
3737
});
38-
39-
if (response.status === 200) {
38+
console.log(response);
39+
if (response.status !== 200) {
4040
setLogin(true)
41+
console.log(response.status);
4142
}
4243
} catch (e) {
4344
setLogin(false);
@@ -107,6 +108,8 @@ export default function LandingPage({ setMainLogin }) {
107108
}
108109
}
109110

111+
console.log(login);
112+
110113
return (
111114
<div>
112115
<S.Body />

src/Page/Quiz/Plant/index.jsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,27 @@ export default function Plant() {
1212
const [text, setText] = useState([]);
1313
const [map, setMap] = useState([]);
1414
const [loading, setLoading] = useState(true);
15-
const [object, setObject] = useState([]);
15+
const [object, setObject] = useState({});
1616
const [dir, setDir] = useState("");
1717

18+
useEffect(() => {
19+
setObject({
20+
0: "/src/assets/map/player.svg",
21+
3: "/src/assets/map/wall.svg",
22+
1000: "/src/assets/map/potion.svg",
23+
1001: "/src/assets/map/tree_wall.svg",
24+
1002: "/src/assets/map/herb.svg",
25+
1003: "/src/assets/map/mushroom1.svg",
26+
1004: "/src/assets/map/mushroom2.svg",
27+
1005: "/src/assets/map/flower.svg",
28+
1006: "/src/assets/map/snake.svg",
29+
1007: "/src/assets/map/tree.svg",
30+
1008: "/src/assets/map/egg.svg",
31+
1009: "/src/assets/map/incubator.svg",
32+
2001: "/src/assets/map/thorn.svg",
33+
});
34+
}, []); // 마운트 시 한 번만 실행
35+
1836
useEffect(() => {
1937
setLoading(true);
2038
const QuizData = async () => {
@@ -52,10 +70,6 @@ export default function Plant() {
5270
}))
5371
]);
5472
setMap(response1.data.map);
55-
setObject({
56-
...response1.data.mapObjectImage,
57-
...response3.data.mapObjectImage
58-
});
5973
setLoading(false);
6074
setDir(response1.data.characterDirection);
6175
} catch (error) {

src/assets/map/door.svg

Lines changed: 6 additions & 0 deletions
Loading

src/assets/map/egg.svg

Lines changed: 5 additions & 0 deletions
Loading

src/assets/map/floor.svg

Lines changed: 10 additions & 0 deletions
Loading

src/assets/map/flower.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)