Skip to content

Commit 5c50c4d

Browse files
committed
added loading message
1 parent 54de2fa commit 5c50c4d

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

debits.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ <h1 class="accountHeader__h1" id="debitsPageName"></h1>
7474
<!-- style this class="form__label"-->
7575
<div class="paybillsdetailsdiv" style="margin-bottom: 2rem">
7676
<input type="date" name="" class="form__input" id="endDate" required>
77-
<label for="endDate" class="signupform__label">Date Of Birth</label>
77+
<label for="endDate" class="signupform__label">End Date</label>
7878
</div>
7979
</div>
8080
<!-- put this in center -->

integration.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ async function handleLogin() {
2121
if (email.trim() === '' || password.trim() === '') {
2222
return false // Prevent the form submission
2323
}
24-
24+
const loading = document.getElementById('loadingBox')
25+
loading.style.display = 'block'
26+
loading.textContent = 'Loading...'
2527
const response = await fetch(
2628
'https://bankapi-6c8a.onrender.com/api/login',
2729
{
@@ -34,6 +36,7 @@ async function handleLogin() {
3436
)
3537

3638
const data = await response.json()
39+
loading.style.display = 'none'
3740
if (data.status == true) {
3841
const token = data.token
3942
localStorage.setItem('token', token)
@@ -73,6 +76,9 @@ async function handleSignUp() {
7376
) {
7477
return false
7578
}
79+
const loading = document.getElementById('loadingBox2')
80+
loading.style.display = 'block'
81+
loading.textContent = 'Loading...'
7682
const response = await fetch(
7783
'https://bankapi-6c8a.onrender.com/api/signup',
7884
{
@@ -90,6 +96,7 @@ async function handleSignUp() {
9096
}
9197
)
9298
const data = await response.json()
99+
loading.style.display = 'none'
93100
if (data.status == false) {
94101
throw new Error(data.message)
95102
}

signin.html

+5
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ <h2 class="heading-secondary">Welcome Back</h2>
107107
</div>
108108

109109
<div id="warningBox" class="warningBox"></div>
110+
<div
111+
id="loadingBox"
112+
class="warningBox"
113+
style="background-color: grey"
114+
></div>
110115

111116
<!-- styles are extra here to fix positioning of submit button -->
112117
<div class="form__group">

signup.html

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
<div class="u-margin-bottom-medium" >
8989
<h2 class="heading-secondary">sign up now</h2>
9090
<div class="warningBox" id="warningBoxSignUp"></div>
91+
<div
92+
id="loadingBox2"
93+
class="warningBox"
94+
style="background-color: grey"
95+
></div>
9196
<div class="successBox" id="successBox"></div>
9297

9398
</div>

0 commit comments

Comments
 (0)