Skip to content

Add host dashboard, charts, reviews, and fleet management components#12

Open
Adekoye-Adewale wants to merge 19 commits into
mainfrom
host
Open

Add host dashboard, charts, reviews, and fleet management components#12
Adekoye-Adewale wants to merge 19 commits into
mainfrom
host

Conversation

@Adekoye-Adewale

Copy link
Copy Markdown
Member

No description provided.

Introduce a new client-side BookingsDonutChart component at components/hostComponents/charts/bookingDonutChart.tsx. Implements a reusable donut (pie) chart using @chakra-ui/charts and recharts with types BookingDonutDataItem and BookingsDonutChartProps, computes a centred total, shows a tooltip, custom sector coloring, and renders a legend with counts and rounded percentage shares.
Introduce a new client-side RevenueChart component (components/hostComponents/charts/revenueChart.tsx). Implements a responsive Recharts area chart with 7/30/90 day filters, sample data generator (defaultGraphData), and typed props (graphData, onFilterChange, isLoading). Includes helpers for formatting, Y-axis ticks, tick thinning, trend calculation, a custom tooltip, and a trend badge; UI uses Tailwind classes and exports relevant types.
Introduce host dashboard UI pieces: a responsive Header (search, notifications with filters, mark-all-read, avatar/logout) and a Collapsible Sidebar (menu groups, submenu animations, user card, collapse trigger). Add notification types/constants and helper icons, TypeScript types for navbar notifications, and sidebar/content constants (menu items and user stub). Includes sample notification data and uses existing UI primitives (Popover, Select, Sidebar) and motion for animations.
Introduce a client-only dynamic import for BookingsDonutChart (with a Skeleton loading fallback and ssr disabled) and add sample chart data constants. constants/saleschartdata.ts provides helper functions for date labels and exports sampleRevenueGraphData (7D/30D/90D series) and sampleBookingDonutData for use by dashboard charts.
Introduce host dashboard layout and page components. Adds app/(host)/us/host/layout.tsx which provides SidebarProvider, ChakraUIProvider and TooltipProvider, renders HostSidebar and DashboardHeader, reads the sidebar_state cookie, and exports page metadata. Adds PageWrapper (components/hostComponents/dashboard/pageWrapper.tsx) for consistent page headings and layout. Adds a client DashboardPageComponent (components/hostComponents/pages/dashboardPageComponents/index.tsx) containing overview cards, revenue chart, bookings donut, recent bookings table and fleet status UI (uses sample data and dynamic imports). Update app/(host)/us/host/page.tsx to render the new DashboardPageComponent.
Introduce a reusable client-side DataTable with toolbar, search, select/date filters, pagination, CSV export, and built-in edit/delete dialogs (components/hostComponents/dashboard/customTable.tsx). Add a small CardIntro component for dashboard headings (components/hostComponents/dashboard/cardIntro.tsx). Add RecentBookingsTable as an example consumer using useTableRows with mock data and the new DataTable (components/hostComponents/pages/dashboardPageComponents/recentBookingsTable.tsx). The table uses namespaced URL params for state (search, filters, sort, page) to enable bookmarkable/filterable tables.
Introduce a new Maintenance UI: adds app/(host)/us/host/maintenance/page.tsx and components under components/hostComponents/pages/maintenance. Includes MaintenancePageComponents (overview cards, service alerts, service history table with mock data, table toolbar and CSV export, and a modal), and LogMaintenanceServiceForm (client-side React Hook Form with validation, date picker, tabs for next-service by mileage/date, and a placeholder submit handler). Wire up modal open/close and a simple PageButton to launch the log form.
Add an optional linkIcon prop to LinkAction and render it in row links. Adjust various UI/UX styles for the table components: change rounded corners to rounded-xs, add cursor-pointer to interactive elements, increase transition duration to 300ms, tweak paddings and typography for TableHead/TableCell and empty state, and adjust search/select/date filter button styles. Also ensure pagination buttons show pointer cursor. These changes polish spacing, readability and affordances across the data table components.
Delete the unused `useMemo` import from components/superAdminPages/pages/settingsPageComponent/adminUsersSettingsPageComponent.tsx to clean up imports and address linter warnings. No functional changes.
Add a host reviews page and its UI components.

- Create app route at app/(host)/us/host/reviews/page.tsx that renders the reviews page component.
- Add a comprehensive ReviewsPageComponents at components/hostComponents/pages/reviewsPageComponents/reviewsPageComponents.tsx which includes:
  - Overview cards for summary metrics.
  - ReviewsTableSection using the existing DataTable/customTable helpers (search, filters, pagination).
  - CSV export action and table link action to open a ReviewModal.
  - ReviewModal driven by the URL query param ?review=<id>, with sorting for comments.
  - StarRating component and mock review data used for UI/demo purposes.

The changes wire up UI behaviors (modal routing, export, filters) and provide a starting dataset and visuals for the host reviews page.
Introduce FilterDef.matchMode ("exact" | "floor") and update useTableRows to support floor matching (useful for numeric ratings stored as decimals). Enhance LinkAction with docs, optional linkIcon and mergeParams (default true) to allow merging current URL params into action hrefs so table state (pagination/filters/sort) is preserved. Implement LinkActionCell component to compute merged href using useSearchParams and replace the inline Link in DataTable. Also add a cursor-pointer class to SelectFilter buttons for better UX.
Delete the unused TestingTable import from components/hostComponents/pages/dashboardPageComponents/index.tsx to clean up dead code and avoid linting/unused-import warnings.
Introduce Fleet management UI: new route page at app/(host)/us/host/fleet/page.tsx, FleetPageComponents (overview cards, Add Vehicle button, PageWrapper) and FleetTable (client component) with mock fleet data. FleetTable wires into existing custom table primitives (useTableRows, DataTable, TableToolbar) and provides columns, search, filters, pagination, export CSV action, edit/delete handlers, and status badges. Mock data and export CSV columns/filename are placeholders to be replaced when integrated with the real API.
Introduce a new "Report An Issue" feature for hosts: adds app routes (report-an-issue index and dynamic [id] page) and multiple UI components. Implement tabbed page with form (reportIssueForm) using react-hook-form, client-side validation, image upload/previews, urgent flag and a submit stub (TODO: replace with real API). Add reports list/table with mock data, pagination helpers and a link to a detailed single report view (singleIssueReportPage) which shows report metadata, attached photos and SwingRides response. Also include ReportStatus UI helper and four sample images under public/images/host.
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
swing-rides_web-app Ready Ready Preview, Comment Jun 12, 2026 5:50pm

@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for reliable-sable-fc0459 ready!

Name Link
🔨 Latest commit 7a03f83
🔍 Latest deploy log https://app.netlify.com/projects/reliable-sable-fc0459/deploys/6a2c46cd80431d000822e346
😎 Deploy Preview https://deploy-preview-12--reliable-sable-fc0459.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant