[openstreetmap/openstreetmap-website] Add user profile heatmap visualization for contributions (PR #5402)
Anton Khorev
notifications at github.com
Fri Jan 31 13:06:47 UTC 2025
@AntonKhorev commented on this pull request.
> + type: "threshold",
+ range: currentTheme === "dark" ? rangeColors : Array.from(rangeColors).reverse(),
+ domain: [10, 20, 30, 40]
+ }
+ }
+ }, [
+ [Tooltip, {
+ text: (date, value) => getTooltipText(date, value, locale)
+ }]
+ ]);
+ }
+});
+
+function getThemeFromColorScheme(colorScheme) {
+ if (colorScheme === "auto") {
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
You already have `mediaQuery` defined. It can be used here:
```suggestion
return mediaQuery.matches ? "dark" : "light";
```
For this to work, declarations have to be moved around. Maybe this function doesn't need to be declared. You already have `if (colorScheme === "auto") ...` above that is not inside a function.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5402#pullrequestreview-2586681226
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5402/review/2586681226 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250131/8f29d874/attachment.htm>
More information about the rails-dev
mailing list