Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Added ProfileButton to cloud mode.

Mike Cao25d4a9cec094
diff --git a/components/input/ProfileButton.js b/components/input/ProfileButton.js
index c7b46a8f9..547054e0b 100644
--- a/components/input/ProfileButton.js
+++ b/components/input/ProfileButton.js
@@ -3,11 +3,13 @@ import { useRouter } from 'next/router';
import Icons from 'components/icons';
import useMessages from 'hooks/useMessages';
import useUser from 'hooks/useUser';
+import useConfig from 'hooks/useConfig';
import styles from './ProfileButton.module.css';
export default function ProfileButton() {
const { formatMessage, labels } = useMessages();
const { user } = useUser();
+ const { cloudMode } = useConfig();
const router = useRouter();
const handleSelect = key => {
@@ -40,12 +42,14 @@ export default function ProfileButton() {
</Icon>
<Text>{formatMessage(labels.profile)}</Text>
</Item>
- <Item key="logout" className={styles.item}>
- <Icon>
- <Icons.Logout />
- </Icon>
- <Text>{formatMessage(labels.logout)}</Text>
- </Item>
+ {!cloudMode && (
+ <Item key="logout" className={styles.item}>
+ <Icon>
+ <Icons.Logout />
+ </Icon>
+ <Text>{formatMessage(labels.logout)}</Text>
+ </Item>
+ )}
</Menu>
</Popup>
</PopupTrigger>
diff --git a/components/layout/NavBar.js b/components/layout/NavBar.js
index bca2cccee..fac9256bc 100644
--- a/components/layout/NavBar.js
+++ b/components/layout/NavBar.js
@@ -50,7 +50,7 @@ export default function NavBar() {
<div className={styles.actions}>
<ThemeButton />
<LanguageButton />
- {!cloudMode && <ProfileButton />}
+ <ProfileButton />
</div>
</Column>
</Row>
diff --git a/components/metrics/MetricsTable.js b/components/metrics/MetricsTable.js
index 8dfae9716..2e20dfc6c 100644
--- a/components/metrics/MetricsTable.js
+++ b/components/metrics/MetricsTable.js
@@ -35,7 +35,10 @@ export default function MetricsTable({
const { get, useQuery } = useApi();
const { data, isLoading, isFetched, error } = useQuery(
- ['websites:metrics', websiteId, type, modified, url, referrer, os, browser, device, country],
+ [
+ 'websites:metrics',
+ { websiteId, type, modified, url, referrer, os, browser, device, country },
+ ],
() =>
get(`/websites/${websiteId}/metrics`, {
type,
diff --git a/components/metrics/WebsiteChart.js b/components/metrics/WebsiteChart.js
index 6d3843c94..1941db340 100644
--- a/components/metrics/WebsiteChart.js
+++ b/components/metrics/WebsiteChart.js
@@ -39,7 +39,7 @@ export default function WebsiteChart({
const { ref, isSticky } = useSticky({ enabled: stickyHeader });
const { data, isLoading, error } = useQuery(
- ['websites:pageviews', websiteId, modified, url, referrer, os, browser, device, country],
+ ['websites:pageviews', { websiteId, modified, url, referrer, os, browser, device, country }],
() =>
get(`/websites/${websiteId}/pageviews`, {
startAt: +startDate,