%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/ncf/static/js/
Upload File :
Create Path :
Current File : /home/opti/public_html/ncf/static/js/55.3169ad23.chunk.js.map

{"version":3,"sources":["app/actions/register.js","app/main/SignUp/index.js"],"names":["registerAction","registerData","password","confirm_password","fetch","SERVER_URL","method","headers","body","JSON","stringify","then","response","json","console","log","status","localStorage","setItem","message","window","location","reload","Option","Select","SignUp","error","getItem","success","setTimeout","removeItem","AuthSection","TopHeader","FormDiv","UncontrolledAlert","className","color","styled","div","section","SignUpForm","useState","countries","setCountries","states","setStates","cities","setCities","useEffect","res","data","name","initialValues","remember","onFinish","values","fullName","fullname","split","first_name","last_name","company_name","companyName","country","label","address","state","city","tel","phone","email","confirmPassword","onFinishFailed","errorInfo","autoComplete","Item","rules","required","placeholder","labelInValue","onChange","value","countryID","key","map","id","stateID","thestates","type","Password","htmlType","href"],"mappings":"qOA8BeA,EA5BQ,SAACC,GACLA,EAAaC,WAAaD,EAAaE,iBACxCC,MAAM,GAAD,OAAIC,aAAJ,kBAAgC,CACnCC,OAAQ,OACRC,QAAQ,CACN,OAAU,mBACV,eAAgB,oBAElBC,KAAMC,KAAKC,UAAUT,KACpBU,MAAK,SAAAC,GAAQ,OAAIA,EAASC,UAC5BF,MAAK,SAAAE,GACFC,QAAQC,IAAIF,EAAM,QACC,MAAhBA,EAAKG,QACNC,aAAaC,QAAQ,gBAAiBT,KAAKC,UAAUG,EAAKM,UACxDC,OAAOC,SAASC,UACK,MAAhBT,EAAKG,QACZC,aAAaC,QAAQ,cAAeT,KAAKC,UAAUG,EAAKM,UACxDC,OAAOC,SAASC,UAEdR,QAAQC,IAAI,wBAItBE,aAAaC,QAAQ,cAAe,uBACpCE,OAAOC,SAASC,W,4DChBxBC,EAAYC,IAAZD,OAkCOE,UA/Bf,WACE,IAAMC,EAAQT,aAAaU,QAAQ,eAC7BC,EAAUX,aAAaU,QAAQ,iBAOrC,OANAE,YAAW,WACTZ,aAAaa,WAAW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AAU,cAErBgB,KAAK,WACLyB,MAAO,CACL,CACEC,UAAU,EACV1D,QAAS,wBANf,SAUG,cAAC,IAAMsE,SAAP,CAAgBX,YAAY,WAAW3C,UAAU,eAIpD,cAAC,IAAKwC,KAAN,CAAaxC,UAAU,cAErBgB,KAAK,kBACLyB,MAAO,CACL,CACEC,UAAU,EACV1D,QAAS,8BANf,SAUE,cAAC,IAAMsE,SAAP,CAAgBX,YAAY,mBAAmB3C,UAAU,kBAI7D,cAAC,IAAKwC,KAAN,UACE,cAAC,IAAD,CAAQxC,UAAU,aAAaqD,KAAK,UAAUE,SAAS,SAAvD,8BAKF,cAAC,IAAKf,KAAN,CAAYxC,UAAU,aAAtB,SACE,0DAA4B,mBAAGwD,KAAK,UAAR","file":"static/js/55.3169ad23.chunk.js","sourcesContent":["import {SERVER_URL, CLIENT_URL} from '../config/server';\r\n\r\nconst registerAction = (registerData) =>{\r\n                if(registerData.password === registerData.confirm_password){\r\n                  fetch(`${SERVER_URL}/auth/register`, {\r\n                    method: 'POST',\r\n                    headers:{\r\n                      'Accept': 'application/json',\r\n                      'Content-Type': 'application/json'\r\n                    },\r\n                    body: JSON.stringify(registerData)\r\n                  }).then(response => response.json())\r\n                  .then(json => {\r\n                      console.log(json, 'json')\r\n                      if(json.status === 200){\r\n                        localStorage.setItem('login-success', JSON.stringify(json.message));\r\n                          window.location.reload();\r\n                      }else if(json.status === 422){\r\n                        localStorage.setItem('login-error', JSON.stringify(json.message));\r\n                        window.location.reload();\r\n                    }else{\r\n                          console.log(\"An error occured\");\r\n                      }\r\n                  });\r\n              }else{\r\n                localStorage.setItem('login-error', 'Password Must Match');\r\n                window.location.reload();\r\n              }\r\n                }\r\n\r\nexport default registerAction\r\n","import React, { useState, useEffect } from 'react';\r\nimport \"./signup.css\"\r\nimport \"../style.css\"\r\nimport TopHeader from \"../../layout/components/TopBar/TopHeader\"\r\n\r\nimport {SERVER_URL} from '../../config/server';\r\nimport registerAction from '../../actions/register'\r\nimport {UncontrolledAlert ,Alert} from 'reactstrap'\r\nimport styled from 'styled-components'\r\nimport { Form, Input, Button, Select } from 'antd';\r\nconst { Option }  = Select;\r\n\r\n\r\nfunction SignUp() {\r\n  const error = localStorage.getItem('login-error');\r\n  const success = localStorage.getItem('login-success');\r\n  setTimeout(function() {\r\n    localStorage.removeItem('login-error');\r\n  }, 500)\r\n  setTimeout(function() {\r\n    localStorage.removeItem('login-success');\r\n  }, 500)\r\n  return (\r\n    <AuthSection>\r\n      <TopHeader/>\r\n        <FormDiv> \r\n        {error ? \r\n          <UncontrolledAlert className=\"mt-5\" color=\"danger\">\r\n            {error}\r\n          </UncontrolledAlert>\r\n          \r\n         : null }\r\n        {success ? \r\n          <UncontrolledAlert className=\"mt-5\" color=\"success\">\r\n            {success}\r\n          </UncontrolledAlert>\r\n          \r\n         : null } \r\n          <SignUpForm/>\r\n        </FormDiv>\r\n    </AuthSection>\r\n  );\r\n}\r\n\r\nexport default SignUp;\r\n\r\nconst FormDiv = styled.div`\r\n  width: 100%;\r\n  min-height: 100vh;\r\n  display: flex;\r\n  flex-direction: column;\r\n  justify-content: center;\r\n  align-items: center;\r\n  background-color: #0000008f;\r\n`;\r\n\r\nconst AuthSection = styled.section`\r\n  width: 100%;\r\n  min-height: 100vh;\r\n  background: url('assets/images/banner/species.png');\r\n  background-size: cover;\r\n  background-position: center;\r\n`;\r\n\r\n\r\n\r\nconst SignUpForm = () => {\r\n\r\n  const [countries, setCountries] = useState([])\r\n  const [states, setStates] = useState([])\r\n  const [cities, setCities] = useState([])\r\n\r\n  useEffect(() => {\r\n    const fetchCountry =() =>{\r\n        fetch(`${SERVER_URL}/location/country`)\r\n        .then(res => res.json())\r\n        .then(json => {\r\n          console.log(json.message, 'json')\r\n          if(json.status === 200){\r\n            setCountries(json.data);\r\n          }else{\r\n              console.log(\"Oops couldn't fetch data\");\r\n          }\r\n      });\r\n        \r\n      }\r\n  \r\n      fetchCountry();\r\n  }, []);\r\n\r\n  const handleCountry = (value) =>{\r\n    let countryID = value.key;\r\n\r\n    const fetchState =() =>{\r\n      fetch(`${SERVER_URL}/location/state/${countryID}`)\r\n      .then(res => res.json())\r\n      .then(json => {\r\n        console.log(json.message, 'json')\r\n        if(json.status === 200){\r\n          setStates(json.data);\r\n        }else{\r\n            console.log(\"Oops couldn't fetch data\");\r\n        }\r\n    });\r\n      \r\n    }\r\n\r\n    fetchState();\r\n  }\r\n\r\n  const handleState = (value) =>{\r\n    let stateID = value.key;\r\n\r\n    const fetchCity =() =>{\r\n      fetch(`${SERVER_URL}/location/city/${stateID}`)\r\n      .then(res => res.json())\r\n      .then(json => {\r\n        console.log(json.message, 'json')\r\n        if(json.status === 200){\r\n          setCities(json.data);\r\n        }else{\r\n            console.log(\"Oops couldn't fetch data\");\r\n        }\r\n    });\r\n      \r\n    }\r\n\r\n    fetchCity();\r\n  }\r\n\r\n\r\n  const onFinish = (values) => {\r\n    const fullName = values.fullname.split(\" \", 2)\r\n    const first_name = fullName[0];\r\n    const last_name = fullName[1];\r\n    const company_name = values.companyName;\r\n    const country = values.country.label;\r\n    const address = values.address;\r\n    const state = values.state.label;\r\n    const city = values.city.label;\r\n    const tel = values.phone;\r\n    const email = values.email;\r\n    const password = values.password;\r\n    const confirm_password = values.confirmPassword;\r\n\r\n\r\n    const registerData= {\r\n      first_name,\r\n      last_name,\r\n      company_name,\r\n      country,\r\n      address,\r\n      state,\r\n      city,\r\n      tel,\r\n      email,\r\n      password,\r\n      confirm_password\r\n    }\r\n\r\n\r\n    registerAction(registerData);\r\n  };\r\n\r\n  const onFinishFailed = (errorInfo) => {\r\n    console.log('Failed:', errorInfo);\r\n  };\r\n\r\n  return (\r\n    <Form className=\"signupform\" name=\"basic\" initialValues={{remember: true,}} onFinish={onFinish} onFinishFailed={onFinishFailed} autoComplete=\"off\">\r\n      \r\n      <h1 className=\"text-white\">SIGN UP</h1>\r\n\r\n      <div className=\"form-item-group\">\r\n        <Form.Item   className=\"formItemcon\"  name=\"fullname\" rules={[{\r\n              required: true,\r\n              message: 'Please enter your full name',\r\n            },]}>\r\n\r\n          <Input placeholder=\"Full Name\" className=\"formItem\" />\r\n        </Form.Item>\r\n\r\n        <Form.Item   className=\"formItemcon\"\r\n          name=\"companyName\"\r\n          rules={[\r\n            {\r\n              required: false,\r\n            },\r\n          ]}\r\n        >\r\n          <Input placeholder=\"Company Name(optional)\" className=\"formItem\" />\r\n        </Form.Item>\r\n      </div>\r\n\r\n\r\n\r\n      <div className=\"form-item-group group\">\r\n\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"address\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Address',\r\n            },\r\n          ]}\r\n        >\r\n          <Input placeholder=\"Address\" className=\"formItem\" />\r\n        </Form.Item>\r\n\r\n        <Form.Item   className=\"formItemcon\"  \r\n          name=\"country\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Country',\r\n            },\r\n          ]}\r\n        >\r\n          <Select placeholder=\"Country\" className=\"formItem\" labelInValue onChange={handleCountry}>\r\n            {countries.map((country) =>(\r\n              <Option key={country.id} value={country.id}>{country.name}</Option>\r\n            ))}\r\n          </Select>\r\n        </Form.Item>\r\n      </div>\r\n\r\n      <div className=\"form-item-group\">\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"state\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Input your state',\r\n            },\r\n          ]}\r\n        >\r\n           <Select placeholder=\"State\" className=\"formItem\" labelInValue onChange={handleState}>\r\n            {states.map((thestates) =>(\r\n              <Option key={thestates.id} value={thestates.id}>{thestates.name}</Option>\r\n            ))}\r\n          </Select>\r\n            \r\n        </Form.Item>\r\n\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"city\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Please input your city',\r\n            },\r\n          ]}\r\n        >\r\n          <Select placeholder=\"City\" className=\"formItem\" labelInValue>\r\n            {cities.map((city) =>(\r\n              <Option key={city.id} value={city.id}>{city.name}</Option>\r\n            ))}\r\n          </Select>\r\n        </Form.Item>\r\n      </div>\r\n\r\n      <div className=\"form-item-group\">\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"phone\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Input your phone number',\r\n            },\r\n          ]}\r\n        >\r\n           <Input placeholder=\"Phone\" className=\"formItem\"/>\r\n            \r\n        </Form.Item>\r\n\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"email\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              type: \"email\",\r\n              message: 'Please input a valid email address',\r\n            },\r\n          ]}\r\n        >\r\n          <Input placeholder=\"Email\" className=\"formItem\" />\r\n        </Form.Item>\r\n      </div>\r\n\r\n      <div className=\"form-item-group\">\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"password\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Enter your password',\r\n            },\r\n          ]}\r\n        >\r\n           <Input.Password placeholder=\"Password\" className=\"formItem\"/>\r\n            \r\n        </Form.Item>\r\n\r\n        <Form.Item   className=\"formItemcon\"\r\n          \r\n          name=\"confirmPassword\"\r\n          rules={[\r\n            {\r\n              required: true,\r\n              message: 'Enter your password again',\r\n            },\r\n          ]}\r\n        >\r\n          <Input.Password placeholder=\"Confirm Password\" className=\"formItem\" />\r\n        </Form.Item>\r\n      </div>\r\n\r\n      <Form.Item>\r\n        <Button className=\"formButton\" type=\"primary\" htmlType=\"submit\">\r\n          Create Account\r\n        </Button>\r\n      </Form.Item>\r\n\r\n      <Form.Item  className=\"signinlink\">\r\n        <h5>Already Have an Account <a href=\"/signin\">Sign In</a></h5>\r\n      </Form.Item>\r\n    </Form>\r\n  );\r\n};\r\n"],"sourceRoot":""}

Zerion Mini Shell 1.0