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":["components/Organisms/FormForgotPassword/schema.js","components/Organisms/FormForgotPassword/index.js"],"sourcesContent":["import * as yup from 'yup';\nimport messages from 'utils/constants/messages';\n\nexport default yup.object().shape({\n emailAddress: yup.string()\n .email(messages.formValidations.invalidEmail)\n .required(messages.formValidations.invalidEmail),\n});\n","import React, { useContext } from 'react';\nimport Button from 'components/Atoms/Button';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\nimport loadable from '@loadable/component';\n\nimport { AppContext } from 'contexts/AppContext';\n\nimport { useSimpleForm } from 'utils/form';\nimport { requestResetPassword } from 'services/authService';\n\n// Schema\nimport schema from './schema';\n\n// Components\nconst Form = loadable(() => import('components/Atoms/Form'));\nconst Alert = loadable(() => import('components/Atoms/Alert'));\nconst TextInput = loadable(() => import('components/Molecules/TextInput'));\n\nconst GridForm = styled(Form)`\n display: grid;\n grid-gap: 30px 0;\n grid-template-columns: 1fr;\n`;\n\nconst ButtonWrapper = styled.div`\n text-align: center;\n`;\n\nconst FormForgotPassword = ({ onSubmitSuccess }) => {\n /**\n * Context\n */\n const { organizationId, propertyId } = useContext(AppContext);\n\n /**\n * Handlers\n */\n const onSubmit = async (values) =>\n requestResetPassword(organizationId, propertyId, values);\n\n const {\n handleSubmit,\n status: { isSubmitting, formErrors, serverError },\n } = useSimpleForm(schema, onSubmit, onSubmitSuccess);\n\n /**\n * Conditional Rendering\n */\n\n const renderAlert = () => {\n if (isSubmitting === false && serverError) {\n return {serverError};\n }\n\n return null;\n };\n\n return (\n \n {renderAlert()}\n \n \n \n \n \n );\n};\n\nFormForgotPassword.propTypes = {\n onSubmitSuccess: PropTypes.func,\n onSubmitFailure: PropTypes.func,\n};\n\nFormForgotPassword.defaultProps = {\n onSubmitSuccess: () => {},\n onSubmitFailure: () => {},\n};\n\nexport default FormForgotPassword;\n"],"names":["yup","shape","emailAddress","email","messages","formValidations","invalidEmail","required","Form","loadable","Alert","TextInput","GridForm","styled","_templateObject","_taggedTemplateLiteral","ButtonWrapper","div","_templateObject2","FormForgotPassword","_ref","onSubmitSuccess","organizationId","propertyId","useContext","AppContext","handleSubmit","status","isSubmitting","formErrors","serverError","useSimpleForm","schema","async","requestResetPassword","values","_jsxs","onSubmit","children","_jsx","type","name","label","placeholder","error","Button","disabled","defaultProps","onSubmitFailure"],"sourceRoot":""}