chat settings require being logged in to view
This commit is contained in:
parent
099713dd50
commit
634a69e79c
|
@ -1,9 +1,15 @@
|
||||||
import { Button } from "@nextui-org/react";
|
import { Button } from "@nextui-org/react";
|
||||||
import { useChatContext } from "../../contexts/ChatContext";
|
import { useChatContext } from "../../contexts/ChatContext";
|
||||||
|
import { useAppContext } from "../../contexts/AppContext";
|
||||||
|
|
||||||
const InnerChatSettings = () => {
|
const InnerChatSettings = () => {
|
||||||
|
const { user: authUser } = useAppContext();
|
||||||
const { user, doLogin, doLogout } = useChatContext();
|
const { user, doLogin, doLogout } = useChatContext();
|
||||||
|
|
||||||
|
if (!authUser) {
|
||||||
|
return <>You must be logged in first</>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!user && <Button onClick={doLogin}>Login</Button>}
|
{!user && <Button onClick={doLogin}>Login</Button>}
|
||||||
|
|
Loading…
Reference in New Issue