Commit 4a61d0d9 authored by 우지원's avatar 우지원
Browse files

Merge remote-tracking branch 'origin/jaeyeoniiiiii' into woojiweon

parents 691577ee 0309cd62
...@@ -22,19 +22,7 @@ function App() { ...@@ -22,19 +22,7 @@ function App() {
<Route path="/profile/:id/update" component={InfoUpdatePage} /> <Route path="/profile/:id/update" component={InfoUpdatePage} />
<Route path="/profile/:id" component={ProfilePage} /> <Route path="/profile/:id" component={ProfilePage} />
<Route path="/room/:roomId/:channelId" component={RoomPage} /> <Route path="/room/:roomId/:channelId" component={RoomPage} />
<Route path="/room/:roomId" component={InitRoomPage}> <Route path="/room/:roomId" component={InitRoomPage} />
{/* <Switch>
<Route path={"/room/:roomId/meeting"}>
<></>
</Route>
<Route path={"/room/:roomId/normal"}>
<></>
</Route>
<Route path={"/room/:roomId/notice"}>
<></>
</Route>
</Switch> */}
</Route>
<Route path="/room/Invite" component={InvitePage} /> <Route path="/room/Invite" component={InvitePage} />
</Switch> </Switch>
{/* </AuthProvider> */} {/* </AuthProvider> */}
......
...@@ -6,7 +6,7 @@ import catchErrors from "../../context/catchError"; ...@@ -6,7 +6,7 @@ import catchErrors from "../../context/catchError";
const id = localStorage.getItem("user"); const id = localStorage.getItem("user");
const INIT_ROOM = { const INIT_ROOM = {
roomid:"", roomId:"",
name: "", name: "",
profileimg: "", profileimg: "",
member: "", member: "",
...@@ -14,21 +14,20 @@ const INIT_ROOM = { ...@@ -14,21 +14,20 @@ const INIT_ROOM = {
const RoomSingle = () => { const RoomSingle = () => {
const [room, setRoom] = useState([INIT_ROOM]); const [room, setRoom] = useState([INIT_ROOM]);
const [error, setError] = useState(""); const [error, setError] = useState("");
// const channelId = 1; const channelId = 'main';
const {roomId}=useParams(); const {roomId}=useParams(room.roomId);
async function getJoinRoom(Id) { async function getJoinRoom(Id) {
try { try {
const User = await userApi.getUser(Id); const User = await userApi.getUser(Id);
const RoomNumArr = User.roomNumber; const RoomNumArr = User.roomNumber;
const Room = await roomApi.getRoom(RoomNumArr); const Room = await roomApi.getRoom(RoomNumArr);
const roomlist = []; let roomlist = [];
for (const prop in Room) { for (let prop in Room) {
roomlist.push({ roomlist.push({
roomId:Room[prop].id, roomId:Room[prop].id,
name: Room[prop].name, name: Room[prop].name,
profileimg: Room[prop].profileimg, profileimg: Room[prop].profileimg,
member: Room[prop].member, member: Room[prop].member.length,
}); });
} }
setRoom(roomlist); setRoom(roomlist);
...@@ -39,7 +38,7 @@ const RoomSingle = () => { ...@@ -39,7 +38,7 @@ const RoomSingle = () => {
useEffect(() => { useEffect(() => {
getJoinRoom(id); getJoinRoom(id);
}, [id]); }, [id]);
console.log(room)
const { profileimg } = room; const { profileimg } = room;
return ( return (
...@@ -47,7 +46,7 @@ const RoomSingle = () => { ...@@ -47,7 +46,7 @@ const RoomSingle = () => {
{room && {room &&
room.map((el) => ( room.map((el) => (
<Link <Link
to={`/room/${el.roomId}/1`} to={`/room/${el.roomId}/${channelId}`}
className="text-decoration-none text-dark" className="text-decoration-none text-dark"
> >
<div <div
...@@ -80,4 +79,4 @@ const RoomSingle = () => { ...@@ -80,4 +79,4 @@ const RoomSingle = () => {
); );
}; };
export default RoomSingle; export default RoomSingle;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment