From cfd2298d24da23fdfc391de10a4d774b9d74f513 Mon Sep 17 00:00:00 2001
From: Alexander Jason <alexanderjason526@gmail.com>
Date: Mon, 13 Nov 2023 19:50:52 +0700
Subject: [PATCH] fix: styling login button

---
 app/components/Navbar.php             | 15 +++++++++++----
 app/public/styles/template/navbar.css |  5 ++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/app/components/Navbar.php b/app/components/Navbar.php
index 935bcde..87137ac 100644
--- a/app/components/Navbar.php
+++ b/app/components/Navbar.php
@@ -39,9 +39,16 @@
                 <?php endif;?>
                 <?php endif;?>
             </ul>
-            <form method="POST"
-                    action="/../user/logout"  >
-                    <input class="section" type="submit" value="Log Out"> </input>
-            </form>
+            <?php if(isset($_SESSION['username'])):?>
+                <form method="POST"
+                        action="/../user/logout"  >
+                        <input class="section" type="submit" value="Log Out"> </input>
+                </form>
+                <?php else : ?>
+                    <form method="GET"
+                        action="/../user/login"  >
+                        <input class="section login" type="submit" id ="login" value="Log In"> </input>
+                </form>
+            <?php endif;?>
         </div>
     </nav>
diff --git a/app/public/styles/template/navbar.css b/app/public/styles/template/navbar.css
index 04b2a37..ff0cfc0 100644
--- a/app/public/styles/template/navbar.css
+++ b/app/public/styles/template/navbar.css
@@ -139,7 +139,10 @@ label #btn {
     align-items: center;
     text-decoration: none;
 }
-
+.login{
+    background-color: white!important;
+    color:teal!important;
+}
 .section .title {
     display: flex;
     text-align: center;
-- 
GitLab