danine1

edit (fragment)

Mar 16th, 2018
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* eslint camelcase:0 */
  2.  
  3. import React from "react";
  4. import PropTypes from "prop-types";
  5. import classnames from "classnames";
  6.  
  7. import { translate } from "react-i18next";
  8. import { Form, Input, Content } from "@ematix/tesseract-component-library";
  9.  
  10. import cls from "./styles.scss";
  11.  
  12. @translate("AdditionalInformation")
  13. class AdditionalEdit extends React.PureComponent {
  14.   static propTypes = {
  15.     t: PropTypes.func.isRequired,
  16.     additionalInfo: PropTypes.instanceOf(Object).isRequired,
  17.     readOnly: PropTypes.bool,
  18.     className: PropTypes.string,
  19.   };
  20.  
  21.   static defaultProps = {
  22.     readOnly: true,
  23.     className: "",
  24.   };
  25.   render() {
  26.     const { className, t, additionalInfo } = this.props;
  27.     const {
  28.       insurance_company,
  29.       insurance_number,
  30.       date_last_medical_check,
  31.       blood_type,
  32.       health_issues,
  33.     } = additionalInfo;
  34.     return (
  35.       <Content>
  36.         <Form
  37.           className={classnames(className)}
  38.           readOnly={this.props.readOnly}
  39.           onSubmit={() => {}}
  40.         >
  41.           <div className={cls.twoColumnsWrapper}>
  42.             <div className={cls.leftCol}>
  43.               <div className={cls.licenses}>
  44.                 <Input
  45.                   label={t("Driving license number")}
  46.                   name="license_number"
  47.                 />
  48.                 <Input label={t("Driving license type")} name="license_type" />
  49.               </div>
  50.               <Input label={t("Other Employment")} name="other" />
  51.               <Input label={t("Previous Employment")} name="previousEmployer" />
  52.               <Input
  53.                 className={cls.safetyTraining}
  54.                 label={t("Safety training")}
  55.                 name="safety_training"
  56.                 iconDate
  57.               />
  58.             </div>
  59.             <div className={cls.rightCol}>
  60.               <Input
  61.                 label={t("Health insurance company")}
  62.                 name="insurance_company"
  63.                 defaultValue={insurance_company}
  64.               />
  65.               <Input
  66.                 label={t("Insurance registration number")}
  67.                 name="insurance_company"
  68.                 defaultValue={insurance_number}
  69.               />
  70.               <div className={cls.checkups}>
  71.                 <Input
  72.                   label={t("Medical checkup")}
  73.                   name="medical_checkup"
  74.                   defaultValue={date_last_medical_check}
  75.                   iconDate
  76.                 />
  77.                 <Input label={t("Next checkup")} name="next_checkup" iconDate />
  78.               </div>
  79.               <Input
  80.                 label={t("Blood type")}
  81.                 name="blood_type"
  82.                 defaultValue={blood_type}
  83.               />
  84.               <div className={cls.addInfoField}>
  85.                 <Input
  86.                   label={t("Additional information")}
  87.                   name="additional_info"
  88.                   defaultValue={health_issues}
  89.                 />
  90.               </div>
  91.             </div>
  92.           </div>
  93.         </Form>
  94.       </Content>
  95.     );
  96.   }
  97. }
  98.  
  99. export default AdditionalEdit;
Add Comment
Please, Sign In to add comment