aboutsummaryrefslogtreecommitdiff
path: root/app/views/components/theme-toggle.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/components/theme-toggle.php')
-rw-r--r--app/views/components/theme-toggle.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/views/components/theme-toggle.php b/app/views/components/theme-toggle.php
new file mode 100644
index 0000000..c28b240
--- /dev/null
+++ b/app/views/components/theme-toggle.php
@@ -0,0 +1,33 @@
+<form
+ class="<?php echo $formClass ?? null; ?>"
+ method="get"
+ action="<?php echo $_SERVER['REQUEST_URI']; ?>"
+>
+ <?php if ($theme->color() === 'dark') { ?>
+
+ <button
+ title="Switch to Light Theme"
+ class="<?php echo $buttonClass ?? null; ?>"
+ name="theme"
+ type="submit"
+ value="light"
+ >
+ <?php echo featherIcon('sun', 'is-hidden-touch'); ?>
+ <span>Light</span>
+ </button>
+
+ <?php } else { ?>
+
+ <button
+ title="Switch to Dark Theme"
+ class="<?php echo $buttonClass ?? null; ?>"
+ name="theme"
+ type="submit"
+ value="dark"
+ >
+ <?php echo featherIcon('moon', 'is-hidden-touch'); ?>
+ <span>Dark</span>
+ </button>
+
+ <?php } ?>
+</form>