This repository has been archived on 2025-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
resolver/docs/layers/components.md
2017-10-21 13:52:08 +07:00

1.5 KiB

Components

This layer include React components that let you split the UI into independent, reusable pieces, and think about each piece in isolation.

Add a new component

To add a new page in Home.jsx (with side-bar and top-bar) :

  • In components/Home.jsx
  • Inside the tag
<SidebarMain>
            <Switch>
            {/* Add your <Route/> here! */}
             </Switch>
</SidebarMain>
  • Add your component route between tag to load in home page
<Route path="/route-name" component={ComponentName} />

To add a new item for menu bar

  • In components/Home.jsx
  • Inside the tag
   <SidebarContent>
      <Menu style={{ color: "rgb(117, 117, 117)", width: '210px' }}>
       {/* Add you <NavLink /> here */}
      </Menu>
    </SidebarContent>
  • Add your component NavLink between tag
<NavLink to='/route-name'>
    <MenuItem primaryText="MenuItemName" style={{ color: "rgb(117, 117, 117)" }} leftIcon={<SvgIcon />} />
    {/* Other menu itemes  */}
</NavLink>

Note: You can choose your icon for from material-ui icons

To add your page in Master page (without side-bar menu and top-bar)

  • In components/Master/Master.tsx
  • Add your tag between tag
<Switch>
         <Route path='/route-name' component={ComponentName} />
         {/* Other routes  */}
</Switch>