updated the balance endpoint and added bootstrap spinner to login page

This commit is contained in:
Kwesi Banson Jnr
2026-07-24 19:50:02 +00:00
parent 6e0154e73f
commit b4e076bdeb
4 changed files with 184 additions and 29 deletions

View File

@@ -77,7 +77,7 @@
<!-- <span class="badge text-bg-light rounded-pill px-3 py-2">Click Mobile</span> -->
</div>
<form class="" action="{{ url('client-login') }}" method="POST">
<form id="loginForm" action="{{ url('client-login') }}" method="POST">
@csrf
<div class="mb-3">
<label for="companyEmail" class="form-label fw-semibold">Email</label>
@@ -85,8 +85,7 @@
<span class="input-group-text bg-white border-end-0 rounded-start-4">
<i class="bi bi-envelope-at"></i>
</span>
<input type="email" name="email" class="form-control" id="companyEmail" placeholder="" value="" autocomplete="">
<input type="email" name="email" class="form-control" id="companyEmail" placeholder="" value="" autocomplete="">
</div>
</div>
@@ -111,9 +110,11 @@
</div>
<div class="d-grid gap-3">
<button type="submit" class="btn btn-click">Sign in to portal</button>
<button type="submit" id="btnSubmit" class="btn btn-click d-flex align-items-center justify-content-center gap-2">
<span class="spinner-border spinner-border-sm d-none" id="loginSpinner" role="status" aria-hidden="true"></span>
<span id="btnText">Sign in to portal</span>
</button>
<a href="" class="btn btn-ghost">Contact Support to Request account</a>
</div>
</form>
@@ -138,5 +139,21 @@
</main>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script>
const loginForm = document.getElementById('loginForm');
const btnSubmit = document.getElementById('btnSubmit');
const loginSpinner = document.getElementById('loginSpinner');
const btnText = document.getElementById('btnText');
loginForm.addEventListener('submit', function (e) {
// Show spinner, change text, and disable button to prevent double-submissions
loginSpinner.classList.remove('d-none');
btnSubmit.disabled = true;
btnText.textContent = 'Signing in...';
// Let the native POST request proceed to Laravel normally
});
</script>
</body>
</html>
</html>