mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
add close button on session modal
This commit is contained in:
parent
2e1a5b444a
commit
f5bf148b2b
2 changed files with 35 additions and 5 deletions
|
|
@ -29,9 +29,11 @@ export function SessionModal({ websiteId, ...props }: SessionModalProps) {
|
||||||
>
|
>
|
||||||
<Column height="100%" maxWidth="1320px" style={{ margin: '0 auto' }}>
|
<Column height="100%" maxWidth="1320px" style={{ margin: '0 auto' }}>
|
||||||
<Dialog variant="sheet">
|
<Dialog variant="sheet">
|
||||||
<Column padding="6">
|
{({ close }) => (
|
||||||
<SessionProfile websiteId={websiteId} sessionId={session} />
|
<Column padding="6">
|
||||||
</Column>
|
<SessionProfile websiteId={websiteId} sessionId={session} onClose={() => close()} />
|
||||||
|
</Column>
|
||||||
|
)}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</Column>
|
</Column>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,14 @@
|
||||||
import { TextField, Row, Column, Tabs, TabList, Tab, TabPanel } from '@umami/react-zen';
|
import {
|
||||||
|
TextField,
|
||||||
|
Row,
|
||||||
|
Column,
|
||||||
|
Tabs,
|
||||||
|
TabList,
|
||||||
|
Tab,
|
||||||
|
TabPanel,
|
||||||
|
Button,
|
||||||
|
Icon,
|
||||||
|
} from '@umami/react-zen';
|
||||||
import { Avatar } from '@/components/common/Avatar';
|
import { Avatar } from '@/components/common/Avatar';
|
||||||
import { LoadingPanel } from '@/components/common/LoadingPanel';
|
import { LoadingPanel } from '@/components/common/LoadingPanel';
|
||||||
import { useMessages, useWebsiteSessionQuery } from '@/components/hooks';
|
import { useMessages, useWebsiteSessionQuery } from '@/components/hooks';
|
||||||
|
|
@ -6,8 +16,17 @@ import { SessionActivity } from './SessionActivity';
|
||||||
import { SessionData } from './SessionData';
|
import { SessionData } from './SessionData';
|
||||||
import { SessionInfo } from './SessionInfo';
|
import { SessionInfo } from './SessionInfo';
|
||||||
import { SessionStats } from './SessionStats';
|
import { SessionStats } from './SessionStats';
|
||||||
|
import { X } from 'lucide-react';
|
||||||
|
|
||||||
export function SessionProfile({ websiteId, sessionId }: { websiteId: string; sessionId: string }) {
|
export function SessionProfile({
|
||||||
|
websiteId,
|
||||||
|
sessionId,
|
||||||
|
onClose,
|
||||||
|
}: {
|
||||||
|
websiteId: string;
|
||||||
|
sessionId: string;
|
||||||
|
onClose?: () => void;
|
||||||
|
}) {
|
||||||
const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId);
|
const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId);
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
|
|
@ -21,6 +40,15 @@ export function SessionProfile({ websiteId, sessionId }: { websiteId: string; se
|
||||||
>
|
>
|
||||||
{data && (
|
{data && (
|
||||||
<Column gap>
|
<Column gap>
|
||||||
|
{onClose && (
|
||||||
|
<Row justifyContent="flex-end">
|
||||||
|
<Button onPress={onClose} variant="quiet">
|
||||||
|
<Icon>
|
||||||
|
<X />
|
||||||
|
</Icon>
|
||||||
|
</Button>
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
<Column gap="6">
|
<Column gap="6">
|
||||||
<Row justifyContent="center" alignItems="center" gap="6">
|
<Row justifyContent="center" alignItems="center" gap="6">
|
||||||
<Avatar seed={data?.id} size={128} />
|
<Avatar seed={data?.id} size={128} />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue