header.tsx 2.01 KB
Newer Older
1
2
3
import React, { useState } from "react";
import { Link, Outlet } from "react-router-dom";
import { useAuth } from "../auth/auth.context";
백승민's avatar
theme1    
백승민 committed
4
5
6
7

import "tailwindcss/tailwind.css";

export default function Header() {
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  const { logout } = useAuth();
  return (
    <div className="flex flex-col ">
      <div className="flex flex-row px-5 py-20 md:place-content-between">
        <button className="px-5 py-2">
          <Link to="/" className="hover:bg-gray-200 focus:text-purple-500">
            Travel Report
          </Link>
        </button>
        <div className="flex flex-row-reverse">
          <button className="px-5 py-2 bg-teal-400 rounded">
            <Link
              to="/login"
              className="hover:bg-teal-100 focus:text-purple-500 "
            >
              Login
            </Link>
            <button
              onClick={() => {
                logout();
              }}
            >
              Logout
백승민's avatar
theme1    
백승민 committed
31
            </button>
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
          </button>
          <button className="px-5 py-2 bg-purple-400 rounded">
            <Link
              to="/board"
              className="hover:bg-purple-300 focus:text-purple-500 "
            >
              Board
            </Link>
          </button>
          <div>
            <label>
              {/* <span className="sr-only">Search</span> */}
              <span className="absolute inset-y-0 left-0 flex items-center pl-2">
                <svg
                  className="h-5 w-5 fill-slate-300"
                  viewBox="0 0 20 20"
                ></svg>
              </span>
              <input
                className="placeholder:italic placeholder:text-slate-400 block bg-white w-full border border-slate-300 rounded-md py-2 pl-9 pr-3 shadow-sm focus:outline-none focus:border-sky-500 focus:ring-sky-500 focus:ring-1 sm:text-sm"
                placeholder="Search for anything..."
                type="text"
                name="search"
              />
            </label>
백승민's avatar
theme1    
백승민 committed
57
58
59
          </div>
        </div>
      </div>
60
61
62
63
      <Outlet />
    </div>
  );
}