Intercode SaaS Kit
  • Welcome to SaaS Starter Kit
  • Getting Started
    • Technology stack
    • Database Setup
    • Local Environment Setup
  • Basics
    • Dependencies
    • App architecture
    • Deployment
    • App roles
    • Endpoints List
      • Auth
      • Two Factor Auth
      • Businesses
      • Demo
      • Email
      • Export Document
      • Email Files
      • Files Demo
      • Leads
      • Orders
      • Payments
      • Subscriptions
      • Teams
      • Team Memberships
      • User Admin
  • Animation and Styles
    • Framer Motion
    • Ant Design and Styles
  • Pages
    • Auth
      • Working with PassportJS
      • Two-Factor Auth
      • OAuth Providers
    • Leads
    • Businesses
    • Team management
      • Ownership
    • Profile
    • User Settings
      • App Tour
    • App Settings
      • Lead Statuses
    • Dashboard
      • Lead volume widget
      • Doughnut chart widget
      • Recent leads table widget
      • Lead count over period widget
    • Demo
  • Features
    • Impersonation
    • Subscriptions (Stripe)
    • Search
    • Sentry
    • Captcha
    • Audit Logs
    • Internationalization
  • External integrations
    • Mailer
    • Google oAuth2
    • Facebook oAuth2
    • S3 compatible storage (AWS, MinIO)
Powered by GitBook
On this page
  1. Pages

Dashboard

Here you will find information about widgets, chart JS library and general page logic

PreviousLead StatusesNextLead volume widget

Last updated 5 months ago

Dashboard page is written with Ant Design Row and Col components which allow us to change sizes of widgets or adapt them to mobile layout easily.

Data for all widgets depends on the Businesses Select and RangePicker (which consists of two separate DatePickers). By default, the range is the last 30 calendar days, but it can be adjusted to any range from 1 day to several years. Regardless of whether the range is selected from left to right or right to left, the logic will pick the range between the dates. The Businesses Select is optimized with a debounce function, so data won't reload immediately. Additionally, the page maintains a state with previous select values, so if the user doesn't change the selections after clicking, the data will not be reloaded.

All charts used in widgets written with react-chartjs-2 library (chart JS wrapper for react).

All widgets fetch data internally, have their own loading state, and can be reloaded separately. To properly support multiple languages, we need to pass a key prop with i18.language value to the chart components to trigger re-rendering when the language changes, ensuring the correct variant of labels is displayed.

Detailed chartJS docs:

Chart.js | Chart.js
Logo