import "./App.scss"; import { useEffect, useState } from "react"; import { init, loginComplete } from "@lumeweb/libkernel/kernel"; import browser from "webextension-polyfill"; import classNames from "classnames"; import { clearLoginKey } from "../../../shared/keys.js"; export default function App() { const [loggedIn, setLoggedIn] = useState(false); useEffect(() => { init().then(() => { loginComplete().then(() => { setLoggedIn(true); }); }); }, [loggedIn]); function openDashboard() { browser.tabs.create({ url: browser.runtime.getURL("dashboard.html"), active: true, }); } function openAccount() { browser.tabs.create({ url: browser.runtime.getURL("account.html"), active: true, }); } function close() { window.close(); } async function logout() { await clearLoginKey(); window.location.reload(); } return ( <>
{loggedIn && (
)}
{!loggedIn && <>Looks like you’re not connected.} {loggedIn && <>Connected to Lume Web.}
{loggedIn && ( )} {!loggedIn && ( )}
); }