-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 라우트 구조 변경 및 동적 라우팅 추가 (페이지 미구현)
- Loading branch information
Showing
16 changed files
with
131 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,5 +65,6 @@ export const InputContainer = styled.div` | |
textarea { | ||
height: 200px; | ||
border: none; | ||
resize: none; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { useParams } from "react-router-dom"; | ||
import { getItemInfo } from "../../apis"; | ||
import styled from "styled-components"; | ||
|
||
function DetailItem() { | ||
const [itemInfo, setItemInfo] = useState(null); | ||
const { itemId } = useParams(); | ||
|
||
useEffect(() => { | ||
const getItem = async () => { | ||
try { | ||
const item = await getItemInfo(itemId); | ||
setItemInfo(item); | ||
} catch (err) { | ||
console.log(err); | ||
} | ||
}; | ||
getItem(); | ||
}, []); | ||
|
||
console.log(); | ||
return ( | ||
<DetailContainer>{itemInfo && <div>{itemInfo.name}</div>}</DetailContainer> | ||
); | ||
} | ||
|
||
export default DetailItem; | ||
|
||
const DetailContainer = styled.div` | ||
margin: 70px 0 0 0; | ||
font-size: 100px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App.jsx"; | ||
import { BrowserRouter, Routes, Route } from "react-router-dom"; | ||
|
||
import Home from "./pages/Home"; | ||
import Auth from "./pages/Auth"; | ||
import Items from "./pages/Items"; | ||
import AddItem from "./pages/AddItem"; | ||
import DetailItem from "./components/items/itemsDetail/DetailItem.jsx"; | ||
|
||
ReactDOM.createRoot(document.getElementById("root")).render( | ||
<React.StrictMode> | ||
<App /> | ||
<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={<App />}> | ||
<Route index element={<Home />} /> | ||
<Route path="auth" element={<Auth />} /> | ||
<Route path="items"> | ||
<Route index element={<Items />}></Route> | ||
<Route path=":itemId" element={<DetailItem />}></Route> | ||
</Route> | ||
<Route path="additem" element={<AddItem />} /> | ||
</Route> | ||
</Routes> | ||
</BrowserRouter> | ||
</React.StrictMode> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters