- Timestamp:
- 09/11/22 18:03:58 (2 years ago)
- Branches:
- master
- Children:
- 775e15e
- Parents:
- 527b93f
- Location:
- phonelux-frontend/src/components/LoginRegisterComponents
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/components/LoginRegisterComponents/LoginFormComponent.css
r527b93f re5b84dc 16 16 width: fit-content; 17 17 box-shadow: 11px 12px 13px 12px rgb(207, 207, 207); 18 padding-top: 30px;18 padding-top: 20px; 19 19 border-radius: 60px; 20 20 background-color: white; … … 23 23 } 24 24 .loginform-imgs-div { 25 padding-top: 20px;25 padding-top: 10px; 26 26 justify-content: center; 27 27 display: flex; … … 43 43 44 44 .loginform-sub-main-div > div{ 45 margin-bottom: 50px;45 margin-bottom: 30px; 46 46 margin-left: 80px; 47 47 margin-right: 80px; … … 137 137 color: blue; 138 138 } 139 .register-link > a{ 140 color: rgb(53, 99, 70); 141 text-decoration: none; 139 140 141 142 .registerform-link{ 143 color: rgb(53, 99, 70); 144 text-decoration: none; 142 145 } 143 146 144 .register -link > a:hover{145 color: blue;147 .registerform-link:hover{ 148 color: blue; 146 149 } 150 151 .loginform-message-wrapper{ 152 display: flex; 153 justify-content: center; 154 } 155 156 .loginform-error-message{ 157 color: red; 158 border: 1px solid red; 159 width: fit-content; 160 padding: 10px; 161 border-radius: 50px; 162 background-color: rgb(251, 224, 224); 163 } -
phonelux-frontend/src/components/LoginRegisterComponents/LoginFormComponent.js
r527b93f re5b84dc 17 17 email: '', 18 18 password: '', 19 serverResponse: '' 19 20 } 20 21 } … … 42 43 43 44 axios(config) 44 .then(function (response) { 45 console.log(response.data); 45 .then((response) => { 46 // store access token in local storage, redirect to homepage 47 console.log(response.data) 46 48 }) 47 .catch(function (error) { 48 console.log(error); 49 .catch((error) => { 50 this.setState({ 51 serverResponse: 'error' 52 }) 49 53 }); 50 54 … … 67 71 <div className="loginform-sub-main-div"> 68 72 <div> 69 73 {this.state.serverResponse == 'error' ? <div className='loginform-message-wrapper'> 74 <h5 className='loginform-error-message'>Невалидна е-маил адреса или лозинка!</h5></div> : <></>} 70 75 <div className="loginform-imgs-div"> 71 76 <div className="loginform-image-container"> … … 93 98 </div> 94 99 </form> 95 <p className='register-link'><Link to={"/register"}><a>Регистрирај се</a></Link></p>100 <p className='register-link'><Link className='registerform-link' to={"/register"}>Регистрирај се</Link></p> 96 101 97 102 </div> -
phonelux-frontend/src/components/LoginRegisterComponents/RegisterFormComponent.css
r527b93f re5b84dc 23 23 } 24 24 .registerform-imgs-div { 25 padding-top: 20px;25 padding-top: 5px; 26 26 justify-content: center; 27 27 display: flex; … … 158 158 } 159 159 160 .registerform-message-wrapper{ 161 display: flex; 162 justify-content: center; 163 } 164 165 .registerform-error-message{ 166 color: red; 167 border: 1px solid red; 168 width: fit-content; 169 padding: 10px; 170 border-radius: 50px; 171 background-color: rgb(251, 224, 224); 172 } 173 174 .registerform-success-message{ 175 color: green; 176 border: 1px solid green; 177 width: fit-content; 178 padding: 10px; 179 border-radius: 50px; 180 background-color: #B6E2C8; 181 } 160 182 161 183 -
phonelux-frontend/src/components/LoginRegisterComponents/RegisterFormComponent.js
r527b93f re5b84dc 20 20 password: '', 21 21 confirmPassword:'', 22 serverResponse: '' 22 23 } 23 24 } … … 43 44 44 45 axios(config) 45 .then(function (response) { 46 console.log(response); 46 .then((response) => { 47 this.setState({ 48 serverResponse: response.data 49 }) 47 50 }) 48 .catch(function (error) { 49 console.log(error); 51 .catch((error) => { 52 this.setState({ 53 serverResponse: error.response.data 54 }) 50 55 }); 51 56 … … 59 64 60 65 61 62 63 66 render() { 64 67 … … 69 72 <div className="registerform-sub-main-div"> 70 73 <div> 74 75 {(() => { 76 if(this.state.serverResponse == '') 77 { 78 return <></> 79 } 80 81 if(this.state.serverResponse != '' && this.state.serverResponse.includes('Error')) 82 { 83 return <div className='registerform-message-wrapper'> 84 <h5 className='registerform-error-message'>{this.state.serverResponse.split(':')[1]}</h5> </div> 85 } 86 87 if(this.state.serverResponse != '' && this.state.serverResponse.includes('token')) 88 { 89 return <div className='registerform-message-wrapper'> 90 <h5 className='registerform-success-message'>Вашата регистрација е во тек. Потврдете на вашата е-маил адреса!</h5> </div> 91 } 92 93 })()} 71 94 72 95 <div className="registerform-imgs-div">
Note:
See TracChangeset
for help on using the changeset viewer.