Add host dashboard, charts, reviews, and fleet management components#12
Open
Adekoye-Adewale wants to merge 19 commits into
Open
Add host dashboard, charts, reviews, and fleet management components#12Adekoye-Adewale wants to merge 19 commits into
Adekoye-Adewale wants to merge 19 commits into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for reliable-sable-fc0459 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.