diff --git a/ui/colony/src/App.tsx b/ui/colony/src/App.tsx index d216f06..b5346d3 100644 --- a/ui/colony/src/App.tsx +++ b/ui/colony/src/App.tsx @@ -1,14 +1,42 @@ import { useCallback, useEffect, useRef, useState } from "react"; import type { Channel } from "@/types/Channel"; import type { Message } from "@/types/Message"; -import { getChannels, getMessages } from "@/api"; +import { getChannels, getMessages, getCurrentUsername } from "@/api"; import { ChannelSidebar } from "@/components/ChannelSidebar"; import { MessageItem } from "@/components/MessageItem"; import { ComposeBox } from "@/components/ComposeBox"; import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; import { useChannelSocket } from "@/hooks/useChannelSocket"; +function GatePage() { + return ( +
+ 🐒 +

+ Ape Colony +

+

+ this is not a place for humans without names. +
+ identify yourself, ape. +

+
+
// add ?user= to the URL
+
apes.unslope.com?user=benji
+
apes.unslope.com?user=neeraj
+
+
+ ); +} + export default function App() { + // Gate: require ?user= param in URL (not just localStorage) + const urlUser = new URL(window.location.href).searchParams.get("user"); + const storedUser = localStorage.getItem("colony_user"); + + if (!urlUser && !storedUser) { + return ; + } const [channels, setChannels] = useState([]); const [activeChannelId, setActiveChannelId] = useState(null); const [messages, setMessages] = useState([]);