Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import * as React from 'react';
  2. import { connect } from "react-redux";
  3. import Switch from '@material-ui/core/Switch';
  4. import FormControl from '@material-ui/core/FormControl';
  5. import { FormControlLabel, FormLabel } from '@material-ui/core';
  6. import Paper from '@material-ui/core/Paper';
  7. import { createStyles, Theme, WithStyles, withStyles } from '@material-ui/core/styles';
  8. import { withNamespaces, WithNamespaces } from 'react-i18next';
  9. import { TextInput, EuroInput, DropDownInput } from '../../shared/inputs';
  10. import Grid from '@material-ui/core/Grid';
  11. import { fetchSecurityPlan, updateSecurityPlan } from '../../store/securityPlan/securityPlan/actions';
  12. import { SecurityPlanThunkDispatch } from '../../store/axiosConfig';
  13. import { SecurityPlanModel, SecurityPlanState } from '../../store/securityPlan/securityPlan/types';
  14. import { AppState } from '../../store';
  15.  
  16. const styles = (theme: Theme) => createStyles({
  17.     valittuAsiakas: {
  18.         fontWeight: 'bold'
  19.     },
  20.     paper: {
  21.         padding: '24px',
  22.         textAlign: 'left',
  23.         color: theme.palette.text.primary,
  24.     }
  25. });
  26.  
  27.  
  28. export interface ClerkProps extends WithStyles<typeof styles>, WithNamespaces {
  29.     onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
  30.     model: SecurityPlanModel;
  31.  
  32.     // securityPlanId: number;
  33.     // securityPlanState: SecurityPlanState;
  34.     // updateSecurityPlan: typeof updateSecurityPlan;
  35. }
  36.  
  37. class Clerk extends React.Component<ClerkProps> {
  38.     render() {
  39.         const { classes } = this.props;
  40.        
  41.         return (
  42.             <div>
  43.                 <h1>4. Myyjän tiedot</h1>
  44.                 <Paper className={classes.paper}>
  45.                     <Grid container={true}>
  46.                         <Grid item={true}>
  47.                         <TextInput
  48.                             inputName="clerkName"
  49.                             label="Toimihenkilö"
  50.                             onInputChange={this.props.onChange}
  51.                             valueForInput={this.props.model.clerkName}
  52.                         />
  53.                         </Grid>
  54.                         <Grid item={true}>
  55.                         <TextInput
  56.                             inputName="clerkName"
  57.                             label="Kustannuspaikka"
  58.                             onInputChange={this.props.onChange}
  59.                             valueForInput={this.props.model.clerkCostcenter}
  60.                         />
  61.                         </Grid>
  62.                     </Grid>
  63.                 </Paper>
  64.             </div>
  65.         )
  66.     }
  67.  
  68.     // onChange = (field: keyof SecurityPlanModel, value: any) => {
  69.     //     var model = { ...this.props.securityPlanState.model, [field]: value }
  70.     //     this.props.updateSecurityPlan(model);
  71.     // };
  72.  
  73. }
  74.  
  75.  
  76. export default (withStyles(styles)(withNamespaces()(Clerk)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement