mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 20:39:44 +01:00
Metrics bar styling.
This commit is contained in:
parent
df66acaacf
commit
24af06f3aa
@ -34,7 +34,7 @@ export default function WebsiteDetails({ websiteId }: { websiteId: string }) {
|
|||||||
<>
|
<>
|
||||||
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
|
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
|
||||||
<FilterTags websiteId={websiteId} params={params} />
|
<FilterTags websiteId={websiteId} params={params} />
|
||||||
<WebsiteMetricsBar websiteId={websiteId} />
|
<WebsiteMetricsBar websiteId={websiteId} showChange={true} sticky={true} />
|
||||||
<WebsiteChart websiteId={websiteId} />
|
<WebsiteChart websiteId={websiteId} />
|
||||||
{!website && <Loading icon="dots" style={{ minHeight: 300 }} />}
|
{!website && <Loading icon="dots" style={{ minHeight: 300 }} />}
|
||||||
{website && (
|
{website && (
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import classNames from 'classnames';
|
|
||||||
import { Button, Icon, Icons, Popup, PopupTrigger, Text } from 'react-basics';
|
import { Button, Icon, Icons, Popup, PopupTrigger, Text } from 'react-basics';
|
||||||
import PopupForm from 'app/(main)/reports/[reportId]/PopupForm';
|
import PopupForm from 'app/(main)/reports/[reportId]/PopupForm';
|
||||||
import FilterSelectForm from 'app/(main)/reports/[reportId]/FilterSelectForm';
|
import FilterSelectForm from 'app/(main)/reports/[reportId]/FilterSelectForm';
|
||||||
@ -31,8 +30,8 @@ export function WebsiteFilterButton({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PopupTrigger>
|
<PopupTrigger className={className}>
|
||||||
<Button className={classNames(className, styles.button)} variant="quiet">
|
<Button className={styles.button} variant="quiet">
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Plus />
|
<Icons.Plus />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
@ -11,9 +11,8 @@
|
|||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
flex-direction: row;
|
align-items: flex-end;
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,12 @@ import { Dropdown, Item } from 'react-basics';
|
|||||||
export function WebsiteMetricsBar({
|
export function WebsiteMetricsBar({
|
||||||
websiteId,
|
websiteId,
|
||||||
sticky,
|
sticky,
|
||||||
|
showChange = false,
|
||||||
compareMode = false,
|
compareMode = false,
|
||||||
}: {
|
}: {
|
||||||
websiteId: string;
|
websiteId: string;
|
||||||
sticky?: boolean;
|
sticky?: boolean;
|
||||||
|
showChange?: boolean;
|
||||||
compareMode?: boolean;
|
compareMode?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
@ -88,6 +90,7 @@ export function WebsiteMetricsBar({
|
|||||||
change={change}
|
change={change}
|
||||||
format={format}
|
format={format}
|
||||||
reverseColors={reverseColors}
|
reverseColors={reverseColors}
|
||||||
|
showChange={compareMode || showChange}
|
||||||
showPrevious={compareMode}
|
showPrevious={compareMode}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -4,6 +4,7 @@ import WebsiteMetricsBar from '../WebsiteMetricsBar';
|
|||||||
import FilterTags from 'components/metrics/FilterTags';
|
import FilterTags from 'components/metrics/FilterTags';
|
||||||
import { useNavigation } from 'components/hooks';
|
import { useNavigation } from 'components/hooks';
|
||||||
import { FILTER_COLUMNS } from 'lib/constants';
|
import { FILTER_COLUMNS } from 'lib/constants';
|
||||||
|
import WebsiteChart from '../WebsiteChart';
|
||||||
|
|
||||||
export function WebsiteComparePage({ websiteId }) {
|
export function WebsiteComparePage({ websiteId }) {
|
||||||
const { query } = useNavigation();
|
const { query } = useNavigation();
|
||||||
@ -20,6 +21,7 @@ export function WebsiteComparePage({ websiteId }) {
|
|||||||
<WebsiteHeader websiteId={websiteId} />
|
<WebsiteHeader websiteId={websiteId} />
|
||||||
<FilterTags websiteId={websiteId} params={params} />
|
<FilterTags websiteId={websiteId} params={params} />
|
||||||
<WebsiteMetricsBar websiteId={websiteId} compareMode={true} />
|
<WebsiteMetricsBar websiteId={websiteId} compareMode={true} />
|
||||||
|
<WebsiteChart websiteId={websiteId} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -61,3 +61,7 @@
|
|||||||
color: var(--red700);
|
color: var(--red700);
|
||||||
background: var(--red100);
|
background: var(--red100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hide {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
@ -24,7 +24,7 @@ export const MetricCard = ({
|
|||||||
reverseColors = false,
|
reverseColors = false,
|
||||||
format = formatNumber,
|
format = formatNumber,
|
||||||
showLabel = true,
|
showLabel = true,
|
||||||
showChange = true,
|
showChange = false,
|
||||||
showPrevious = false,
|
showPrevious = false,
|
||||||
className,
|
className,
|
||||||
}: MetricCardProps) => {
|
}: MetricCardProps) => {
|
||||||
@ -45,6 +45,7 @@ export const MetricCard = ({
|
|||||||
className={classNames(styles.change, {
|
className={classNames(styles.change, {
|
||||||
[styles.positive]: positive,
|
[styles.positive]: positive,
|
||||||
[styles.negative]: negative,
|
[styles.negative]: negative,
|
||||||
|
[styles.hide]: ~~change === 0,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Icon rotate={positive ? -45 : 45} size={showPrevious ? 'sm' : 'xs'}>
|
<Icon rotate={positive ? -45 : 45} size={showPrevious ? 'sm' : 'xs'}>
|
||||||
|
Loading…
Reference in New Issue
Block a user