diff options
author | Thedro Neely <thedroneely@gmail.com> | 2021-12-18 00:12:19 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2021-12-18 00:12:19 -0500 |
commit | 13b69343b9f8cf4be673256010e784ebd846aa95 (patch) | |
tree | 6d67f82bdf6572614d9fd6669f770d05cff25377 /app/views/components | |
parent | 7a61c746f0ee5d999c88414bf206a30781b87e31 (diff) | |
download | thedroneely.com-13b69343b9f8cf4be673256010e784ebd846aa95.tar.gz thedroneely.com-13b69343b9f8cf4be673256010e784ebd846aa95.tar.bz2 thedroneely.com-13b69343b9f8cf4be673256010e784ebd846aa95.zip |
app/model/Navigation: Simplify active route logic
Diffstat (limited to 'app/views/components')
-rw-r--r-- | app/views/components/navigator.link.dropdown.php | 7 | ||||
-rw-r--r-- | app/views/components/navigator.link.php | 6 |
2 files changed, 2 insertions, 11 deletions
diff --git a/app/views/components/navigator.link.dropdown.php b/app/views/components/navigator.link.dropdown.php index be937f8..0657bc6 100644 --- a/app/views/components/navigator.link.dropdown.php +++ b/app/views/components/navigator.link.dropdown.php @@ -1,10 +1,5 @@ <a href="<?php echo $route ?? null; ?>" - class=" - <?php - echo $check = ($label === 'Home') - ? ($navigation->isActiveHome() ? ' navbar__active' : '') - : ($navigation->isActive($route ?? null) ? ' navbar__active' : ''); - ?> navbar-item" + class="<?php if ($navigation->isActive($route ?? null)) { echo ' navbar__active'; } ?> navbar-item" title="<?php echo $label ?? null; ?>" > <?php echo $label ?? null; ?> diff --git a/app/views/components/navigator.link.php b/app/views/components/navigator.link.php index a129acf..3b57d62 100644 --- a/app/views/components/navigator.link.php +++ b/app/views/components/navigator.link.php @@ -1,12 +1,8 @@ <a href="<?php echo $route ?? null; ?>" class="navbar-item navbar__icon has-text-centered <?php - $hiddenLabels = [ 'Profile' ]; if (in_array($label, $hiddenLabels)) { echo ' navbar__icon__hidden'; } - - echo $check = ($label === 'Home') - ? ($navigation->isActiveHome() ? ' navbar__active' : '') - : ($navigation->isActive($route ?? null) ? ' navbar__active' : ''); + if ($navigation->isActive($route ?? null)) { echo ' navbar__active'; } ?> "> <div class="has-text-centered"> |