mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 21:27:20 +01:00
Updates to Revenue report.
This commit is contained in:
parent
4995a0e1e4
commit
095d1f2070
19 changed files with 365 additions and 416 deletions
|
|
@ -50,6 +50,7 @@ export function Panel({
|
|||
borderRadius="3"
|
||||
backgroundColor
|
||||
position="relative"
|
||||
overflowX="hidden"
|
||||
gap
|
||||
{...props}
|
||||
style={{ ...style, ...(isFullscreen ? fullscreenStyles : {}) }}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export function TypeIcon({
|
|||
<Row gap="3" alignItems="center">
|
||||
<img
|
||||
src={`${process.env.basePath || ''}/images/${type}/${
|
||||
value?.replaceAll(' ', '-').toLowerCase() || 'xx'
|
||||
value?.replaceAll(' ', '-').toLowerCase() || 'unknown'
|
||||
}.png`}
|
||||
onError={e => {
|
||||
e.currentTarget.src = `${process.env.basePath || ''}/images/${type}/unknown.png`;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export function useFormat() {
|
|||
};
|
||||
|
||||
const formatCountry = (value: string): string => {
|
||||
return countryNames[value] || value;
|
||||
return countryNames[value] || value || labels.unknown;
|
||||
};
|
||||
|
||||
const formatRegion = (value?: string): string => {
|
||||
|
|
|
|||
34
src/components/input/CurrencySelect.tsx
Normal file
34
src/components/input/CurrencySelect.tsx
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { CURRENCIES } from '@/lib/constants';
|
||||
import { ListItem, Select } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
export function CurrencySelect({ value, onChange }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const [search, setSearch] = useState('');
|
||||
|
||||
return (
|
||||
<Select
|
||||
items={CURRENCIES}
|
||||
label={formatMessage(labels.currency)}
|
||||
value={value}
|
||||
defaultValue={value}
|
||||
onChange={onChange}
|
||||
listProps={{ style: { maxHeight: '300px' } }}
|
||||
onSearch={setSearch}
|
||||
allowSearch
|
||||
>
|
||||
{CURRENCIES.map(({ id, name }) => {
|
||||
if (search && !`${id}${name}`.toLowerCase().includes(search)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<ListItem key={id} id={id}>
|
||||
{id} — {name}
|
||||
</ListItem>
|
||||
);
|
||||
}).filter(n => n)}
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ export function CountriesTable({ ...props }: MetricsTableProps) {
|
|||
value={(countryNames[code] && code) || code}
|
||||
label={formatCountry(code)}
|
||||
>
|
||||
<TypeIcon type="country" value={code?.toLowerCase()} />
|
||||
<TypeIcon type="country" value={code} />
|
||||
</FilterLink>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ export function EventsChart({ websiteId, className, focusLabel }: EventsChartPro
|
|||
|
||||
return (
|
||||
<BarChart
|
||||
minDate={startDate.toISOString()}
|
||||
maxDate={endDate.toISOString()}
|
||||
minDate={startDate}
|
||||
maxDate={endDate}
|
||||
className={className}
|
||||
data={chartData}
|
||||
unit={unit}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue