Header.js 2.61 KB
Newer Older
seoyeon's avatar
0705    
seoyeon committed
1
import { Link } from 'react-router-dom'
seoyeon's avatar
seoyeon committed
2
3
import { handleLogout } from '../context/auth'

Kim, Chaerin's avatar
Kim, Chaerin committed
4
const Header = () => {
우지원's avatar
0802    
우지원 committed
5
  const id = localStorage.getItem('user');
Kim, Chaerin's avatar
Kim, Chaerin committed
6
7
  return (
    <div>
8
      <form
seoyeon's avatar
0705    
seoyeon committed
9
        style={{ backgroundColor: '#FCF4FF' }}
10
11
        className="flex-column align-items-center justify-content-center p-2"
      >
seoyeon's avatar
seoyeon committed
12
13
        <div className="d-flex justify-content-end">
          <div>
우지원's avatar
0802    
우지원 committed
14
            <Link to={`/user/${id}`}>
seoyeon's avatar
seoyeon committed
15
16
              <img src="/BORA.png" style={{ width: '160px' }} />
            </Link>
seoyeon's avatar
seoyeon committed
17
18
19
20
21
22
23
          </div>
          <button
            type="button"
            className=" mt-3 ms-5 rounded"
            data-bs-toggle="modal"
            data-bs-target="#logout"
            style={{
seoyeon's avatar
seoyeon committed
24
              height: '30px',
seoyeon's avatar
seoyeon committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
              backgroundColor: '#E0CEE8',
              color: 'black',
              border: '1px #E0CEE8',
            }}
          >
            로그아웃
          </button>
          <div
            className="modal fade"
            id="logout"
            tabIndex="-1"
            aria-labelledby="logoutLabel"
            aria-hidden="true"
          >
            <div className="modal-dialog">
              <div className="modal-content">
                <div className="modal-header">
                  <button
                    type="button"
                    className="btn-close"
                    data-bs-dismiss="modal"
                    aria-label="Close"
                  ></button>
                </div>
                <div className="modal-body d-flex justify-content-center">
                  로그아웃 하시겠습니까?
                </div>
                <div className="row mb-3">
                  <div className="d-flex justify-content-evenly">
seoyeon's avatar
seoyeon committed
54
                    <Link to="/" className="col-2 p-1 btn btn-primary">
우지원's avatar
0802    
우지원 committed
55
56
57
58
59
60
61
62
                      <button
                        type="submit"
                        className="btn btn-primary"
                        onClick={() => handleLogout()}
                        data-bs-dismiss="modal"
                      >
                        
                      </button>
seoyeon's avatar
seoyeon committed
63
                    </Link>
seoyeon's avatar
seoyeon committed
64
65
66
67
68
69
70
71
72
73
74
75
                    <button
                      type="submit"
                      className="col-2 p-1 btn btn-primary"
                      data-bs-dismiss="modal"
                    >
                      아니요
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </div>
76
77
78
        </div>
      </form>
      <div
seoyeon's avatar
0705    
seoyeon committed
79
        style={{ backgroundColor: '#262626', width: 'auto', height: '2px' }}
80
      ></div>
Kim, Chaerin's avatar
Kim, Chaerin committed
81
    </div>
seoyeon's avatar
0705    
seoyeon committed
82
83
  )
}
Kim, Chaerin's avatar
Kim, Chaerin committed
84

seoyeon's avatar
0705    
seoyeon committed
85
export default Header