mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
Added ProfileButton to cloud mode.
This commit is contained in:
parent
f56374b259
commit
25d4a9cec0
@ -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>
|
||||
|
@ -50,7 +50,7 @@ export default function NavBar() {
|
||||
<div className={styles.actions}>
|
||||
<ThemeButton />
|
||||
<LanguageButton />
|
||||
{!cloudMode && <ProfileButton />}
|
||||
<ProfileButton />
|
||||
</div>
|
||||
</Column>
|
||||
</Row>
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user