// DEPLOY_CONFIG: {"triggers": [{"name": "reaction_notification_on_post_reaction", "on": "collection.add", "collection": "reactions", "actions": [{"type": "event", "event_type": "create_reaction_notification", "payload": {"reaction_id": "{{id}}", "post_id": "{{post_id}}", "reactor_id": "{{user_id}}", "reaction_type": "{{type}}"}}]}]} import { useState } from 'react'; import { useAuth, usePresence } from '@deplixo/sdk'; import { Feed } from './components/Feed.jsx'; import { ComposeModal } from './components/ComposeModal.jsx'; function App() { const { user, loading, login, logout } = useAuth(); const [showCompose, setShowCompose] = useState(false); const [activeTag, setActiveTag] = useState(null); const { users: onlineUsers } = usePresence({ status: 'online' }); usePresence( user ? { id: user.id, name: user.name, email: user.email, avatar: user.avatar, status: 'online', } : null ); if (loading) { return
Signing in...
; } if (!user) { return (

Claypost

Micro thoughts, beautifully shared

Sign in with Google to post, react, and connect with your audience.

); } const visibleOnlineUsers = onlineUsers?.filter((u) => u?.id) || []; const onlineCount = visibleOnlineUsers.length; return (

Claypost

{user.avatar ? {user.name} : {user.name?.[0] || 'U'}} {user.name}

Micro thoughts, beautifully shared

{onlineCount} online{onlineCount === 1 ? ' user' : ' users'}
{visibleOnlineUsers.slice(0, 5).map((onlineUser) => ( {onlineUser.avatar ? ( {onlineUser.name} ) : ( {onlineUser.name?.[0] || 'U'} )} ))}
{activeTag && (
Filtering by #{activeTag}
)}
{showCompose && ( setShowCompose(false)} /> )}
); } export default App; ReactDOM.createRoot(document.getElementById("root")).render();