From e74609d375ef9ca83a7eba64dbb49536b756f473 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Tue, 27 May 2025 13:16:09 +0200 Subject: [PATCH] Re-add GitHub issues config from old docs repo Signed-off-by: Julius Volz --- .github/ISSUE_TEMPLATE/config.yml | 9 ++++++++ .github/PULL_REQUEST_TEMPLATE.md | 7 ++++++ src/components/ThemeSelector.tsx | 36 ++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..d5738395 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,9 @@ +blank_issues_enabled: true +contact_links: + - name: Prometheus Community Support + url: https://prometheus.io/community/ + about: If you need help or support, please request help here. + - name: Commercial Support & Training + url: https://prometheus.io/support-training/ + about: If you want commercial support or training, vendors are listed here. + - name: Blank issue template diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..644450b4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ + diff --git a/src/components/ThemeSelector.tsx b/src/components/ThemeSelector.tsx index 19e841a2..ec4fa085 100644 --- a/src/components/ThemeSelector.tsx +++ b/src/components/ThemeSelector.tsx @@ -1,9 +1,19 @@ -import { useMantineColorScheme, rem, ActionIcon } from "@mantine/core"; +"use client"; + +import { + rem, + ActionIcon, + useComputedColorScheme, + useMantineColorScheme, +} from "@mantine/core"; import { IconBrightnessFilled, IconSun, IconMoon } from "@tabler/icons-react"; import { FC } from "react"; export const ThemeSelector: FC = () => { - const { colorScheme, setColorScheme } = useMantineColorScheme(); + const { setColorScheme } = useMantineColorScheme(); + const computedColorScheme = useComputedColorScheme("light", { + getInitialValueInEffect: true, + }); const iconProps = { style: { width: rem(20), height: rem(20), display: "block" }, stroke: 1.5, @@ -14,36 +24,36 @@ export const ThemeSelector: FC = () => { color="gray" variant="subtle" title={`Switch to ${ - colorScheme === "light" + computedColorScheme === "light" ? "dark" - : colorScheme === "dark" + : computedColorScheme === "dark" ? "browser-preferred" : "light" } theme`} aria-label={`Switch to ${ - colorScheme === "light" + computedColorScheme === "light" ? "dark" - : colorScheme === "dark" + : computedColorScheme === "dark" ? "browser-preferred" : "light" } theme`} size={32} onClick={() => setColorScheme( - colorScheme === "light" + computedColorScheme === "light" ? "dark" - : colorScheme === "dark" + : computedColorScheme === "dark" ? "auto" : "light" ) } > - {colorScheme === "light" ? ( - - ) : colorScheme === "dark" ? ( - + {computedColorScheme === "light" ? ( + + ) : computedColorScheme === "dark" ? ( + ) : ( - + )} );