habra.
  • Introduction
  • Extensions
  • Contributing
  • 🚀Self-host
    • Cloning and installation
    • Running
  • 📂structure
    • How it renders
    • Styles
    • Redux store
    • Routing
    • Locales
Powered by GitBook
On this page

Was this helpful?

  1. structure

Routing

PreviousRedux storeNextLocales

Last updated 3 years ago

Was this helpful?

All routes are described in file. It contains an array of Routes and a Route follows this structure:

interface Route {
  // Path string, ex. /companies/:id
  // To route your component on multiple paths, add them in an array.
  path: string | string[]
  
  // Your component
  component: MemoExoticComponent<() => React.ReactElement> | React.ReactElement
  
  // Title for the window.
  // ex. 'Companies' will be displayed like 'Companies | habra.' in your browser tab
  title?: string
  
  // Should show app bar AND bottom bar on page
  shouldShowAppBar?: boolean
  
  // App bar color
  appBarColor?: (theme: Theme) => string
  
  // [Deprecated] Changes app bar color from theme.palette.background.default to paper
  // on scroll
  shouldAppBarChangeColors?: boolean
  
  // Page alias (slug), camel-cased
  alias: string
}

📂
config/routes.ts