Settings.js 650 Bytes
import localforage from "localforage";
import { Navigate, useNavigate } from "react-router-dom";

import "../styles/Settings.css";

const Settings = () => {
  // console.log("visit Settings");

  const session = localforage.getItem("session");

  const navigate = useNavigate();

  return session ? (
    <div className="Settings">
      <button
        onClick={() => {
          navigate(-1);
        }}
      >
        {"ᐸ"}
      </button>
      <button
        onClick={() => {
          navigate("/debug");
        }}
      >
        디버그
      </button>
    </div>
  ) : (
    <Navigate to="/login" />
  );
};

export default Settings;