File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- export * from './submodule-list.component ' ;
1+ export * from './submodule-list.container ' ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { useHistory } from 'react-router-dom' ;
3- import { routes } from 'core/router' ;
2+ import { DashboardComponent , DashboardItemProps } from 'common/components' ;
43
5- export const SumoduleListComponent : React . FunctionComponent = ( ) => {
6- const history = useHistory ( ) ;
7- const goToProjectList = (
8- event : React . MouseEvent < HTMLParagraphElement , MouseEvent >
9- ) => {
10- event . preventDefault ( ) ;
11- history . push ( {
12- pathname : routes . projects ,
13- } ) ;
14- } ;
4+ interface Props {
5+ items : DashboardItemProps [ ] ;
6+ }
157
16- const goToEmployeeList = (
17- event : React . MouseEvent < HTMLParagraphElement , MouseEvent >
18- ) => {
19- event . preventDefault ( ) ;
20- history . push ( {
21- pathname : routes . employees ,
22- } ) ;
23- } ;
24-
25- return (
26- // Pending to use dashboard component
27- < >
28- < h1 > Hello Submodule List</ h1 >
29- < p onClick = { goToProjectList } > Go to Project list page</ p >
30- < p onClick = { goToEmployeeList } > Go to Employee list page</ p >
31- </ >
32- ) ;
8+ export const SumoduleListComponent : React . FunctionComponent < Props > = props => {
9+ const { items } = props ;
10+ return < DashboardComponent items = { items } /> ;
3311} ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { SumoduleListComponent } from './submodule-list.component' ;
3+ import { DashboardItemProps } from 'common/components' ;
4+ import { routes } from 'core/router' ;
5+ import AccountBalanceIcon from '@material-ui/icons/AccountBalance' ;
6+ import GroupIcon from '@material-ui/icons/Group' ;
7+
8+ export const SubmoduleListContainer : React . FunctionComponent = ( ) => {
9+ const items : DashboardItemProps [ ] = React . useMemo (
10+ ( ) : DashboardItemProps [ ] => [
11+ {
12+ title : 'Proyectos' ,
13+ linkTo : routes . projects ,
14+ icon : AccountBalanceIcon ,
15+ } ,
16+ {
17+ title : 'Empleados' ,
18+ linkTo : routes . employees ,
19+ icon : GroupIcon ,
20+ } ,
21+ ] ,
22+ [ ]
23+ ) ;
24+
25+ return < SumoduleListComponent items = { items } /> ;
26+ } ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { AppLayout } from 'layouts' ;
3- import { SumoduleListComponent } from 'pods/submodule-list' ;
3+ import { SubmoduleListContainer } from 'pods/submodule-list' ;
44
55export const SubmoduleListScene : React . FC = ( ) => {
66 return (
77 < AppLayout >
8- < SumoduleListComponent />
8+ < SubmoduleListContainer />
99 </ AppLayout >
1010 ) ;
1111} ;
You can’t perform that action at this time.
0 commit comments