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

Kim, Chaerin's avatar
Kim, Chaerin committed
6
const RoomSingle = () => {
Kim, Chaerin's avatar
merge19    
Kim, Chaerin committed
7
8
  const [roomNum, setRoomNum] = useState('')
  const [room, setRoom] = useState([])
권병윤's avatar
as    
권병윤 committed
9
10
  // const roomId = localStorage.getItem('user');
  const roomId = "abc7654321"
seoyeon's avatar
seoyeon committed
11
  const channelId = 1
Kim, Chaerin's avatar
merge19    
Kim, Chaerin committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  const A = []

  // async function getJoinRoom(Id) {
  //   try {
  //     console.log('id:',id)
  //     const User = await userApi.getUser({id: Id})
  //     console.log('User1:',User)
  //     console.log('User2:',User.roomNumber)
  //     const RoomNumArr = User.roomNumber
  //     console.log('setRoomNum:',RoomNumArr)
  //     const Room = await roomApi.getRoom(RoomNumArr)
  //   } catch (error) {
  //     // catchErrors(error, setError)
  //   }
  // }

  // useEffect(() => {
  //   getJoinRoom(id)
  // }, [id])

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

seoyeon's avatar
seoyeon committed
62
63
64
    </Link>
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
65

seoyeon's avatar
seoyeon committed
66
export default RoomSingle