From ef40e7415cf090eda70b15072915e7d34bbaf236 Mon Sep 17 00:00:00 2001 From: Ajelmar Medina Date: Sat, 16 Dec 2023 00:17:38 +0800 Subject: [PATCH 1/4] Issue #6, #5, #4, #3, #2 --- src/index.html | 9 +++------ src/script.js | 12 ++++++------ src/styles.css | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/index.html b/src/index.html index e7c4417..a01a38b 100644 --- a/src/index.html +++ b/src/index.html @@ -8,16 +8,13 @@
- - + - - + - - +
diff --git a/src/script.js b/src/script.js index 4e3be16..6d6d9d4 100644 --- a/src/script.js +++ b/src/script.js @@ -24,10 +24,10 @@ addEventListener("submit", (event) => { console.log(`email submitted: ${email}`); console.log(`password submitted: ${password}`); - /* - TODO: - 1. Check if the email and password are valid (using the usersTable) - 2. If they are, call renderSuccess() - 3. If they are not, call renderError() - */ + + if (usersTable.find(user => { + return user.username === email && user.password === password + })) { + renderSuccess(); + } else renderError(); }); diff --git a/src/styles.css b/src/styles.css index 25969e5..0dbb1fd 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,7 +1,7 @@ body { height: 100vh; display: flex; - /* TODO: Adjust CSS so that form is centered on page */ + justify-content: center; align-items: center; } From 2024dfd851f9a0a79605f9aa2eeb1c6d9140ebd8 Mon Sep 17 00:00:00 2001 From: Ajelmar Medina Date: Sat, 16 Dec 2023 00:36:05 +0800 Subject: [PATCH 2/4] fix html validation issue #3 --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index a01a38b..c774ec6 100644 --- a/src/index.html +++ b/src/index.html @@ -12,7 +12,7 @@ - + From 07cfc8481a2660b95030c07ea505bb21b514429b Mon Sep 17 00:00:00 2001 From: Ajelmar Medina Date: Sat, 16 Dec 2023 00:39:57 +0800 Subject: [PATCH 3/4] fix validation --- .vscode/settings.json | 5 +++++ src/script.js | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e11c735 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] +} \ No newline at end of file diff --git a/src/script.js b/src/script.js index 6d6d9d4..b84c72f 100644 --- a/src/script.js +++ b/src/script.js @@ -25,9 +25,6 @@ addEventListener("submit", (event) => { console.log(`email submitted: ${email}`); console.log(`password submitted: ${password}`); - if (usersTable.find(user => { - return user.username === email && user.password === password - })) { - renderSuccess(); - } else renderError(); + if (usersTable.find(user => user.username === email && user.password === password)) renderSuccess(); + else renderError(); }); From 7d1790eb34c3dfcb1e8d967faf134036e2597c2c Mon Sep 17 00:00:00 2001 From: Ajelmar Medina Date: Sat, 16 Dec 2023 00:44:15 +0800 Subject: [PATCH 4/4] . --- src/index.html | 2 +- src/script.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index c774ec6..9579c59 100644 --- a/src/index.html +++ b/src/index.html @@ -12,7 +12,7 @@ - + diff --git a/src/script.js b/src/script.js index b84c72f..fbd75a6 100644 --- a/src/script.js +++ b/src/script.js @@ -25,6 +25,10 @@ addEventListener("submit", (event) => { console.log(`email submitted: ${email}`); console.log(`password submitted: ${password}`); - if (usersTable.find(user => user.username === email && user.password === password)) renderSuccess(); - else renderError(); + if (usersTable.find(user => user.username === email && user.password === password)) { + renderSuccess(); + } + else { + renderError(); + } });