mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 20:45:39 +01:00
dim map strokes for dark theme
This commit is contained in:
parent
bb534bec66
commit
8d024e2931
1 changed files with 9 additions and 1 deletions
|
|
@ -21,6 +21,14 @@ export function WorldMap({ data = [], className }: { data?: any[]; className?: s
|
|||
const visitorsLabel = formatMessage(labels.visitors).toLocaleLowerCase(locale);
|
||||
const metrics = useMemo(() => (data ? percentFilter(data) : []), [data]);
|
||||
|
||||
function getStrokeColor(code: string) {
|
||||
if (code === 'AQ') return;
|
||||
|
||||
return theme === 'light'
|
||||
? colors.map.strokeColor
|
||||
: colord(colors.map.strokeColor).darken(0.2).toHex();
|
||||
}
|
||||
|
||||
function getFillColor(code: string) {
|
||||
if (code === 'AQ') return;
|
||||
const country = metrics?.find(({ x }) => x === code);
|
||||
|
|
@ -64,7 +72,7 @@ export function WorldMap({ data = [], className }: { data?: any[]; className?: s
|
|||
key={geo.rsmKey}
|
||||
geography={geo}
|
||||
fill={getFillColor(code)}
|
||||
stroke={colors.map.strokeColor}
|
||||
stroke={getStrokeColor(code)}
|
||||
opacity={getOpacity(code)}
|
||||
style={{
|
||||
default: { outline: 'none' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue