RoomSingle.js 1.7 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
0728    
우지원 committed
11
  const A = []
우지원's avatar
우지원 committed
12

우지원's avatar
0728    
우지원 committed
13
14
15
16
17
18
19
20
21
22
23
24
25
  // 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)
  //   }
  // }
우지원's avatar
우지원 committed
26

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

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

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

seoyeon's avatar
seoyeon committed
65
export default RoomSingle