📄️ Hooks Overview
Custom React hooks reference for CommonPlace
📄️ useFriendship
Manages the full friendship lifecycle between the current user and another user
📄️ useIntentStyles
Fetch and manage per-user visual styles for post intents
📄️ usePostPresets
Fetch available post presets from the database
📄️ useClickOutside
Detect clicks outside a referenced element
📄️ useEscapeKey
Handle Escape key press events
📄️ useLocalStorage
Persist state to localStorage with JSON serialization
📄️ useMeBookQuestion
Manage responses for a single MeBook question
📄️ useCircleCharter
Fetch and manage circle charters with toggle-based norms
📄️ useSharedCircles
Find shared circles between users and check block status within circles
📄️ useThemeSwitcher
Switch between experimental visual themes
📄️ useSteppedAway
Detect and manage conversations where the user has stepped away
📄️ useMessageReactions
Manage message reactions with a curated emoji set
📄️ useConversation
Manage a single conversation's messages, state, and participants
📄️ useRelationshipTypes
Fetch and manage relationship type definitions (system and custom)
📄️ useAdmin
Check admin status, roles, and permissions for the current user
📄️ useAuditLog
Fetch, filter, paginate, and export admin audit logs
📄️ useAutoSave
Auto-save composer drafts to IndexedDB
📄️ useDashboardMetrics
Fetch admin dashboard metrics with auto-refresh
📄️ useDrag
Draggable and resizable element hooks with mouse and touch support
📄️ useFriends
Fetch, search, filter, and select from the current user's friends list
📄️ useIdleDetection
Detect user idle state after a configurable inactivity timeout
📄️ useInviteLinks
Manage personal invite links for the invite-only signup flow
📄️ usePrivacyCurtain
Manages privacy curtain state, preferences, and idle-detection-triggered screen cover
📄️ useUserLookup
Exact username lookup with rate limiting — returns a single user or null
📄️ useDrafts
Manages composer drafts with auto-save, pinning, and mix-and-match content loading
📄️ useIsMobile
Responsive hooks for detecting mobile viewport and named breakpoints
📄️ useShareNotifications
Processes share notifications in batches and provides notification state with real-time updates
📄️ useNotifications
Full notification management with real-time updates, optimistic UI, and mark-as-read actions
📄️ useSteppedBack
Manages "stepped back" relationship state — temporary, private breaks from seeing a friend's posts
📄️ useAdminUsers
Admin hooks for user search, detailed user views, and moderation actions (warn, suspend, ban)
📄️ useShareToCircle
Manages sharing posts to circles with modal state, validation, and W.E.L. cultural prompts
📄️ useBuildOn
Manages "Build On" post creation — referencing and responding to other posts in a dialogue chain
📄️ useReport
Submits content and behavior reports with rate limiting and predefined reason categories
📄️ useAccountTier
Manages account tier state, restrictions, and tier-aware rate limiting for new/established/trusted accounts
📄️ useCircles
Full CRUD hooks for circles — list, create, manage members, invitations, view rules, and circle posts
📄️ useBlock
Block management hooks — check block state, block/unblock users, manage blocked list, and profile visibility
📄️ useDataRetention
Manages data retention settings, post archiving, and GDPR data export requests
📄️ useRelationshipEncryption
Client-side encryption for relationship data — key derivation, encrypt/decrypt, and migration from plaintext
📄️ useRelationshipEdges
CRUD hooks for directional relationship edges with optional client-side encryption
📄️ useRateLimit
Frontend rate limit checking, recording, and user-friendly error handling for all action types
📄️ useCircleFeedState
Per-circle feed pacing hooks — track last-checked state and new post counts without polling
📄️ useFocusTrap
Traps keyboard focus within a container element for accessible modals and dialogs