Settings.js
417 Bytes
import { Navigate, useNavigate } from "react-router-dom";
const Settings = () => {
const session = localStorage.getItem("session");
const navigate = useNavigate();
return session ? (
<div className="Settings">
<button
onClick={() => {
navigate(-1);
}}
>
{"<"}
</button>
</div>
) : (
<Navigate to="/login" />
);
};
export default Settings;