RoomSingle.js 1.65 KB
Newer Older
우지원's avatar
우지원 committed
1
import { useEffect, useState } from 'react';
seoyeon's avatar
seoyeon committed
2
import { Link } from 'react-router-dom'
우지원's avatar
e    
우지원 committed
3
import roomApi from '../../apis/room.api';
우지원's avatar
우지원 committed
4
5
import userApi from '../../apis/user.api';

Kim, Chaerin's avatar
Kim, Chaerin committed
6
const RoomSingle = () => {
우지원's avatar
0728    
우지원 committed
7
  const [roomNum, setRoomNum] = useState('')
우지원's avatar
e    
우지원 committed
8
  const [room, setRoom] = useState([])
우지원's avatar
우지원 committed
9
  const id = localStorage.getItem('user');
seoyeon's avatar
seoyeon committed
10
  const channelId = 1
우지원's avatar
우지원 committed
11

우지원's avatar
0728    
우지원 committed
12
13
  // async function getJoinRoom(Id) {
  //   try {
이재연's avatar
aaa    
이재연 committed
14
15
16
17
  //     const user = await userApi.getUser({id: Id})
  //     console.log('User1:',user)
  //     console.log('User2:',user.roomNumber)
  //     const RoomNumArr = user.roomNumber
우지원's avatar
0728    
우지원 committed
18
19
20
21
22
23
  //     console.log('setRoomNum:',RoomNumArr)
  //     const Room = await roomApi.getRoom(RoomNumArr)
  //   } catch (error) {
  //     // catchErrors(error, setError)
  //   }
  // }
우지원's avatar
우지원 committed
24

우지원's avatar
0728    
우지원 committed
25
26
27
  // useEffect(() => {
  //   getJoinRoom(id)
  // }, [id])
우지원's avatar
우지원 committed
28

Kim, Chaerin's avatar
Kim, Chaerin committed
29
  return (
seoyeon's avatar
seoyeon committed
30
31
32
33
    <Link
      to={`/room/${id}/${channelId}`}
      className="text-decoration-none text-dark"
    >
Kim, Chaerin's avatar
Kim, Chaerin committed
34
      <div
우지원's avatar
우지원 committed
35
        className="d-flex mx-4 my-2 p-2"
seoyeon's avatar
seoyeon committed
36
        style={{ backgroundColor: '#C4C4C4' }}
Kim, Chaerin's avatar
Kim, Chaerin committed
37
      >
seoyeon's avatar
seoyeon committed
38
        <div style={{ width: '37px', height: '37px' }}>
Kim, Chaerin's avatar
Kim, Chaerin committed
39
40
41
          <img
            src="BORA.png"
            className="rounded-circle"
seoyeon's avatar
seoyeon committed
42
            style={{ width: '37px', height: '37px' }}
Kim, Chaerin's avatar
Kim, Chaerin committed
43
44
          />
        </div>
seoyeon's avatar
seoyeon committed
45
46
47
48
49
50
51
52
53
54
55
        <div
          className="mx-3 mt-2"
          style={{
            width: '250px',
            overflow:'scroll',
            whiteSpace: 'nowrap',
            msOverflowStyle:'none',
          }}
        >
          데계 재미있는 수학과 데계데계데계 재미있는 수학과
        </div>
우지원's avatar
우지원 committed
56
        <div className="ms-auto mt-2"> 15/34 </div>
Kim, Chaerin's avatar
Kim, Chaerin committed
57
      </div>
우지원's avatar
우지원 committed
58

seoyeon's avatar
seoyeon committed
59
60
61
    </Link>
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
62

seoyeon's avatar
seoyeon committed
63
export default RoomSingle