fix: move theme toggle into shared top-bar controls
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
$showSettings = isset($showSettings) ? (bool) $showSettings : false;
|
||||
$settingsUrl = isset($settingsUrl) ? (string) $settingsUrl : url('/settings');
|
||||
?>
|
||||
<div class="flex items-center space-x-4">
|
||||
<button
|
||||
id="themeToggle"
|
||||
type="button"
|
||||
class="bg-blue-600 hover:bg-blue-700 text-white p-2 rounded-lg shadow-sm transition"
|
||||
aria-label="Switch to dark mode"
|
||||
title="Switch to dark mode"
|
||||
aria-pressed="false"
|
||||
>
|
||||
<i id="themeToggleIcon" class="bi bi-moon-stars-fill" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
<?php if ($showSettings): ?>
|
||||
<a href="<?php echo htmlspecialchars($settingsUrl); ?>" class="theme-text-muted hover:opacity-95">
|
||||
<i class="bi bi-gear-fill text-2xl" aria-hidden="true"></i>
|
||||
<span class="sr-only">Settings</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<noscript>
|
||||
<style>
|
||||
#themeToggle {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
Reference in New Issue
Block a user