import { Icon } from "element/icon"; import "./layout.css"; import { EventPublisher, } from "@snort/system"; import { Outlet, useNavigate, useLocation, Link } from "react-router-dom"; import AsyncButton from "element/async-button"; import { Login } from "index"; import { useLogin } from "hooks/login"; import { Profile } from "element/profile"; import { NewStreamDialog } from "element/new-stream"; import { useState } from "react"; export function LayoutPage() { const navigate = useNavigate(); const login = useLogin(); const location = useLocation(); async function doLogin() { const pub = await EventPublisher.nip7(); if (pub) { Login.loginWithPubkey(pub.pubKey); } } function loggedIn() { if (!login) return; return ( <> ); } function loggedOut() { if (login) return; return ( <> Login ); } const isNsfw = window.location.pathname === "/nsfw"; return (
navigate("/")}>
Adult (18+)
{loggedIn()} {loggedOut()}
{isNsfw && }
); } function ContentWarningOverlay() { const navigate = useNavigate(); const [is18Plus, setIs18Plus] = useState(Boolean(window.localStorage.getItem("accepted-content-warning"))); if (is18Plus) return null; function grownUp() { window.localStorage.setItem("accepted-content-warning", "true"); setIs18Plus(true); } return

Sexually explicit material ahead!

Confirm your age

}