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

import "../styles/Settings.css";
import { dataForage } from "../utils/LocalForage";

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

  const session = dataForage.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;