File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import { Formik , Form } from 'formik' ;
3+ import { TextFieldComponent , CheckboxComponent } from 'common/components' ;
4+ import { CommandFooterComponent } from '../../../common-app/command-footer' ;
25
36export const DataComponent : React . FunctionComponent = ( ) => {
4- return < h1 > Hello Data Component</ h1 > ;
7+ return (
8+ < Formik initialValues = { { } } enableReinitialize = { true } onSubmit = { console . log } >
9+ { ( ) => (
10+ < Form >
11+ < TextFieldComponent
12+ label = "Id"
13+ name = "id"
14+ InputProps = { {
15+ readOnly : true ,
16+ } }
17+ />
18+ < TextFieldComponent label = "Nombre" name = "name" />
19+ < TextFieldComponent label = "Id Externo" name = "externalId" />
20+ < TextFieldComponent label = "Comentarios" name = "comments" multiline />
21+ < CheckboxComponent label = "Activo" name = "isActive" color = "primary" />
22+ </ Form >
23+ ) }
24+ </ Formik >
25+ ) ;
526} ;
Original file line number Diff line number Diff line change @@ -11,15 +11,21 @@ import {
1111 ReportComponent ,
1212} from './components' ;
1313
14- export const ProjectComponent : React . FunctionComponent = ( ) => {
14+ interface Props {
15+ isEditMode : boolean ;
16+ }
17+
18+ export const ProjectComponent : React . FunctionComponent < Props > = ( {
19+ isEditMode,
20+ } ) => {
1521 const [ tab , setTab ] = React . useState ( 0 ) ;
1622 return (
1723 < >
1824 < AppBar position = "static" >
1925 < TabListComponent value = { tab } onChange = { setTab } >
2026 < TabComponent label = "Datos" />
21- < TabComponent label = "Empleados" />
22- < TabComponent label = "Informes" />
27+ < TabComponent label = "Empleados" disabled = { isEditMode } />
28+ < TabComponent label = "Informes" disabled = { isEditMode } />
2329 </ TabListComponent >
2430 </ AppBar >
2531 < TabPanelComponent value = { tab } index = { 0 } >
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { ProjectComponent } from './project.component' ;
3+ import { useParams } from 'react-router-dom' ;
34
45export const ProjectContainer : React . FunctionComponent = ( ) => {
5- return < ProjectComponent /> ;
6+ const { id } = useParams ( ) ;
7+ const [ isEditMode , setIsEditMode ] = React . useState < boolean > ( false ) ;
8+
9+ return < ProjectComponent isEditMode = { isEditMode } /> ;
610} ;
You can’t perform that action at this time.
0 commit comments