From e13e630cd6e4fc0b1ff92098a28a770794c7bb9a Mon Sep 17 00:00:00 2001
From: gabrhr <73925454+gabrhr@users.noreply.github.com>
Date: Wed, 20 Apr 2022 10:19:29 -0500
Subject: =?UTF-8?q?A=C3=B1adir=20plantilla?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Base para front
---
 front/odiparpack/app/components/Forms/LockForm.js  | 123 +++++++++++++
 front/odiparpack/app/components/Forms/LoginForm.js | 147 +++++++++++++++
 .../app/components/Forms/MaterialDropZone.js       | 202 +++++++++++++++++++++
 .../app/components/Forms/ReduxFormMUI.js           |  69 +++++++
 .../app/components/Forms/RegisterForm.js           | 174 ++++++++++++++++++
 front/odiparpack/app/components/Forms/ResetForm.js |  71 ++++++++
 .../app/components/Forms/helpers/helpers.js        |   8 +
 front/odiparpack/app/components/Forms/user-jss.js  | 179 ++++++++++++++++++
 8 files changed, 973 insertions(+)
 create mode 100644 front/odiparpack/app/components/Forms/LockForm.js
 create mode 100644 front/odiparpack/app/components/Forms/LoginForm.js
 create mode 100644 front/odiparpack/app/components/Forms/MaterialDropZone.js
 create mode 100644 front/odiparpack/app/components/Forms/ReduxFormMUI.js
 create mode 100644 front/odiparpack/app/components/Forms/RegisterForm.js
 create mode 100644 front/odiparpack/app/components/Forms/ResetForm.js
 create mode 100644 front/odiparpack/app/components/Forms/helpers/helpers.js
 create mode 100644 front/odiparpack/app/components/Forms/user-jss.js
(limited to 'front/odiparpack/app/components/Forms')
diff --git a/front/odiparpack/app/components/Forms/LockForm.js b/front/odiparpack/app/components/Forms/LockForm.js
new file mode 100644
index 0000000..c667809
--- /dev/null
+++ b/front/odiparpack/app/components/Forms/LockForm.js
@@ -0,0 +1,123 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { withStyles } from '@material-ui/core/styles';
+import classNames from 'classnames';
+import { Field, reduxForm } from 'redux-form/immutable';
+import ArrowForward from '@material-ui/icons/ArrowForward';
+import Help from '@material-ui/icons/Help';
+import dummy from 'ba-api/dummyContents';
+import avatarApi from 'ba-api/avatars';
+import {
+  Button,
+  Popover,
+  FormControl,
+  IconButton,
+  Typography,
+  InputAdornment,
+  Paper,
+  Avatar,
+} from '@material-ui/core';
+import { TextFieldRedux } from './ReduxFormMUI';
+import styles from './user-jss';
+
+
+// validation functions
+const required = value => (value == null ? 'Required' : undefined);
+
+class LockForm extends React.Component {
+  state = {
+    anchorEl: null,
+  };
+
+  handleShowHint = event => {
+    this.setState({
+      anchorEl: event.currentTarget,
+    });
+  };
+
+  handleClose = () => {
+    this.setState({
+      anchorEl: null,
+    });
+  };
+
+  render() {
+    const {
+      classes,
+      handleSubmit,
+      pristine,
+      submitting
+    } = this.props;
+    const { anchorEl } = this.state;
+    return (
+      
+    );
+  }
+}
+
+LockForm.propTypes = {
+  classes: PropTypes.object.isRequired,
+  handleSubmit: PropTypes.func.isRequired,
+  pristine: PropTypes.bool.isRequired,
+  submitting: PropTypes.bool.isRequired,
+};
+
+const LockFormReduxed = reduxForm({
+  form: 'immutableELockFrm',
+  enableReinitialize: true,
+})(LockForm);
+
+export default withStyles(styles)(LockFormReduxed);
diff --git a/front/odiparpack/app/components/Forms/LoginForm.js b/front/odiparpack/app/components/Forms/LoginForm.js
new file mode 100644
index 0000000..d652480
--- /dev/null
+++ b/front/odiparpack/app/components/Forms/LoginForm.js
@@ -0,0 +1,147 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { withStyles } from '@material-ui/core/styles';
+import classNames from 'classnames';
+import { Field, reduxForm } from 'redux-form/immutable';
+import { connect } from 'react-redux';
+import Visibility from '@material-ui/icons/Visibility';
+import VisibilityOff from '@material-ui/icons/VisibilityOff';
+import AllInclusive from '@material-ui/icons/AllInclusive';
+import Brightness5 from '@material-ui/icons/Brightness5';
+import People from '@material-ui/icons/People';
+import ArrowForward from '@material-ui/icons/ArrowForward';
+import { Button, IconButton, InputAdornment, FormControl, FormControlLabel } from '@material-ui/core';
+import styles from './user-jss';
+import { TextFieldRedux, CheckboxRedux } from './ReduxFormMUI';
+import { ContentDivider } from '../Divider';
+import PapperBlock from '../PapperBlock/PapperBlock';
+
+
+// validation functions
+const required = value => (value == null ? 'Required' : undefined);
+const email = value => (
+  value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value)
+    ? 'Invalid email'
+    : undefined
+);
+
+class LoginForm extends React.Component {
+  state = {
+    showPassword: false
+  }
+
+  handleClickShowPassword = () => {
+    this.setState({ showPassword: !this.state.showPassword });
+  };
+
+  handleMouseDownPassword = event => {
+    event.preventDefault();
+  };
+
+  render() {
+    const {
+      classes,
+      handleSubmit,
+      pristine,
+      submitting
+    } = this.props;
+    return (
+      
+    );
+  }
+}
+
+LoginForm.propTypes = {
+  classes: PropTypes.object.isRequired,
+  handleSubmit: PropTypes.func.isRequired,
+  pristine: PropTypes.bool.isRequired,
+  submitting: PropTypes.bool.isRequired,
+};
+
+const LoginFormReduxed = reduxForm({
+  form: 'immutableExample',
+  enableReinitialize: true,
+})(LoginForm);
+
+const reducer = 'login';
+const FormInit = connect(
+  state => ({
+    force: state,
+    initialValues: state.getIn([reducer, 'usersLogin'])
+  }),
+)(LoginFormReduxed);
+
+export default withStyles(styles)(FormInit);
diff --git a/front/odiparpack/app/components/Forms/MaterialDropZone.js b/front/odiparpack/app/components/Forms/MaterialDropZone.js
new file mode 100644
index 0000000..c62b3fd
--- /dev/null
+++ b/front/odiparpack/app/components/Forms/MaterialDropZone.js
@@ -0,0 +1,202 @@
+import React from 'react';
+import Dropzone from 'react-dropzone';
+import PropTypes from 'prop-types';
+import classNames from 'classnames';
+import { withStyles } from '@material-ui/core/styles';
+import Button from '@material-ui/core/Button';
+import FileIcon from '@material-ui/icons/Description';
+import ActionDelete from '@material-ui/icons/Delete';
+import IconButton from '@material-ui/core/IconButton';
+import Snackbar from '@material-ui/core/Snackbar';
+import CloudUpload from '@material-ui/icons/CloudUpload';
+import { lighten } from '@material-ui/core/styles/colorManipulator';
+import 'ba-styles/vendors/react-dropzone/react-dropzone.css';
+import isImage from './helpers/helpers.js';
+
+const styles = theme => ({
+  dropItem: {
+    borderColor: theme.palette.secondary.main,
+    background: lighten(theme.palette.secondary.light, 0.9),
+    borderRadius: 2
+  },
+  uploadIconSize: {
+    width: 51,
+    height: 51,
+    color: theme.palette.secondary.main,
+    margin: '0 auto'
+  },
+  rightIcon: {
+    marginLeft: theme.spacing(1),
+  },
+  button: {
+    marginTop: 20
+  }
+});
+
+class MaterialDropZone extends React.Component {
+  constructor(props) {
+    super(props);
+
+    this.state = {
+      openSnackBar: false,
+      errorMessage: '',
+      files: this.props.files, // eslint-disable-line
+      acceptedFiles: this.props.acceptedFiles // eslint-disable-line
+    };
+    this.onDrop = this.onDrop.bind(this);
+  }
+
+  onDrop(filesVal) {
+    const { files } = this.state;
+    const { filesLimit } = this.props;
+    let oldFiles = files;
+    const filesLimitVal = filesLimit || '3';
+    oldFiles = oldFiles.concat(filesVal);
+    if (oldFiles.length > filesLimit) {
+      this.setState({
+        openSnackBar: true,
+        errorMessage: 'Cannot upload more than ' + filesLimitVal + ' items.',
+      });
+    } else {
+      this.setState({ files: oldFiles });
+    }
+  }
+
+  onDropRejected() {
+    this.setState({
+      openSnackBar: true,
+      errorMessage: 'File too big, max size is 3MB',
+    });
+  }
+
+  handleRequestCloseSnackBar = () => {
+    this.setState({
+      openSnackBar: false,
+    });
+  };
+
+  handleRemove(file, fileIndex) {
+    const thisFiles = this.state.files; // eslint-disable-line
+    // This is to prevent memory leaks.
+    window.URL.revokeObjectURL(file.preview);
+
+    thisFiles.splice(fileIndex, 1);
+    this.setState({ files: thisFiles });
+  }
+
+  render() {
+    const {
+      classes,
+      showPreviews,
+      maxSize,
+      text,
+      showButton,
+      filesLimit,
+      ...rest
+    } = this.props;
+
+    const {
+      acceptedFiles,
+      files,
+      openSnackBar,
+      errorMessage
+    } = this.state;
+    const fileSizeLimit = maxSize || 3000000;
+    const deleteBtn = (file, index) => (
+      
+        
 this.handleRemove(file, index)}>
+          
+        
+      
+            
+              

+              {deleteBtn(file, index)}
+            
+          
+          
+            
+            {deleteBtn(file, index)}
+          
+        
+        
 { dropzoneRef = node; }}
+          {...rest}
+        >
+          {({ getRootProps, getInputProps }) => (
+            
+          )}
+          {/* end */}
+        
+        {showButton && (
+          
+        )}
+        
+          {showPreviews && previews(files)}
+        
+        
+      
+        
+          
+            
+            
+          
+          {tab === 0
+            && (
+              
+            )
+          }
+          {tab === 1
+            && (
+              
+                
+                
+                
+              
+