Skip to content

[FE-42] Admin hub settings page (/admin/settings) #1300

Description

@yusuftomilola

Overview

Hub operators have no UI to configure operational settings — business hours, booking rules, tax rates, and branding are all hardcoded or environment-variable-only. The hub settings page gives operators full control without touching config files.

Context

  • Admin pages pattern: frontend/app/admin/members/page.tsx
  • Depends on BE-54 for GET /hub-settings and PATCH /hub-settings
  • Branding settings link with white-labeling (FE-38)

Tasks

  • Create /admin/settings page with tabbed sections:
    • General: Hub name, address, city, country, contact email, contact phone — editable fields with a "Save" button
    • Booking Rules: Lead time (hours), max days ahead, cancellation policy hours — numeric inputs
    • Business Hours: Day-of-week toggle + open/close time pickers for Mon–Sun; "Closed" toggle per day
    • Financial: VAT rate percent input (e.g. 7.5), currency display (read-only, NGN)
    • Branding: Logo upload (Cloudinary), primary colour hex picker, favicon upload
  • Each tab section has its own "Save Changes" button that calls PATCH /hub-settings with only that section's fields
  • Show a success toast on save and an error toast if the request fails
  • Business hours picker: time inputs constrained to 30-minute intervals; "Closed" toggle disables the time inputs for that day
  • Create useGetHubSettings and useUpdateHubSettings React Query hooks

Files to Modify / Create

  • New: frontend/app/admin/settings/page.tsx
  • New: frontend/lib/react-query/hooks/admin/settings/useGetHubSettings.ts
  • New: frontend/lib/react-query/hooks/admin/settings/useUpdateHubSettings.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions