Skip to content

Commit

Permalink
refactor (login) : change handle disable when button is submitting
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaroz committed Dec 1, 2023
1 parent 20ee484 commit 4a19c0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/components/layout-components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default function Sidebar() {
const selectedKeys = location.pathname.match(regex)[0];

const openLogoutModal = () => {
console.log("Opening Logout Modal");
setShowLogoutModal(true);
};

Expand Down
23 changes: 7 additions & 16 deletions src/views/auth-views/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,13 @@ const Login = () => {

{/* Button */}
<div className="mt-16">
{isSubmitting ? (
<button
id="submit-button"
className="w-full rounded-lg bg-green-500 px-4 py-4 text-xl font-bold text-grey-10 hover:bg-green-600 disabled:bg-green-700"
disabled
>
Masuk
</button>
) : (
<button
id="submit-button"
className="w-full rounded-lg bg-green-500 px-4 py-4 text-xl font-bold text-grey-10 hover:bg-green-600"
>
Masuk
</button>
)}
<button
id="submit-button"
className="w-full rounded-lg bg-green-500 px-4 py-4 text-xl font-bold text-grey-10 hover:bg-green-600 disabled:bg-green-700"
disabled={isSubmitting}
>
Masuk
</button>
</div>
</form>
</div>
Expand Down

0 comments on commit 4a19c0e

Please sign in to comment.