Skip to content

feat(admin): build /admin/settings page for hub configuration#1318

Merged
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
YaronZaki:fix/issue-1102-admin-settings-page
Jun 29, 2026
Merged

feat(admin): build /admin/settings page for hub configuration#1318
yusuftomilola merged 2 commits into
DistinctCodes:mainfrom
YaronZaki:fix/issue-1102-admin-settings-page

Conversation

@YaronZaki

@YaronZaki YaronZaki commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1102
Closes #1103
Closes #1104
Closes #1105

Builds the admin-only Hub Settings page at /admin/settings, mirroring the existing admin pages (admin/payments, admin/announcements).

Page sections

  1. Basic Info — Hub Name, Description, Contact Email, Contact Phone, Logo URL (with inline preview; a Cloudinary upload widget is planned as a follow-up).
  2. Business Hours — per-day grid (Monday → Sunday) with an Open / Closed toggle and open / close time inputs.
  3. Address — full address text field.
  4. Tax & Currency — Tax Rate (numeric %, 0–100) and Currency (read-only NGN per [GF-FE-07] Build admin hub settings page /admin/settings #1102 acceptance criteria).
  5. Timezone — dropdown of common African / global timezones (default Africa/Lagos).

A single Save settings button PATCHes /hub-settings via useUpdateHubSettings, shows a success toast on save, and shows the error message inline on failure.

New / changed files

  • frontend/app/admin/settings/page.tsx (new) — the settings page itself.
  • frontend/components/dashboard/DashboardSidebar.tsx — adds a Settings entry under adminItems so it's reachable from the admin sidebar (page inherits the existing /admin/* middleware guard, so only admins / super_admins can reach it).
  • frontend/lib/react-query/hooks/admin/hub-settings/useGetHubSettings.ts (new) — wraps the existing GET /hub-settings endpoint.
  • frontend/lib/react-query/hooks/admin/hub-settings/useUpdateHubSettings.ts (new) — wraps PATCH /hub-settings and invalidates the cache on success.

The hooks are tiny but were required for the page to function.

Acceptance criteria coverage

  • frontend/app/admin/settings/page.tsx accessible via /admin/settings
  • Page is admin / super_admin only (role check + middleware)
  • Pre-populates from GET /hub-settings
  • Save calls PATCH /hub-settings with a success / error toast
  • Business Hours grid with toggle + time inputs for all 7 days
  • Linked from the admin sidebar navigation
  • Logo upload widget — see follow-up note: URL input + preview today, file upload via Cloudinary planned.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@YaronZaki is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@YaronZaki Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@yusuftomilola yusuftomilola merged commit 1627b0d into DistinctCodes:main Jun 29, 2026
0 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants