mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +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' }}>
|
||||
<Dialog variant="sheet">
|
||||
<Column padding="6">
|
||||
<SessionProfile websiteId={websiteId} sessionId={session} />
|
||||
</Column>
|
||||
{({ close }) => (
|
||||
<Column padding="6">
|
||||
<SessionProfile websiteId={websiteId} sessionId={session} onClose={() => close()} />
|
||||
</Column>
|
||||
)}
|
||||
</Dialog>
|
||||
</Column>
|
||||
</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 { LoadingPanel } from '@/components/common/LoadingPanel';
|
||||
import { useMessages, useWebsiteSessionQuery } from '@/components/hooks';
|
||||
|
|
@ -6,8 +16,17 @@ import { SessionActivity } from './SessionActivity';
|
|||
import { SessionData } from './SessionData';
|
||||
import { SessionInfo } from './SessionInfo';
|
||||
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 { formatMessage, labels } = useMessages();
|
||||
|
||||
|
|
@ -21,6 +40,15 @@ export function SessionProfile({ websiteId, sessionId }: { websiteId: string; se
|
|||
>
|
||||
{data && (
|
||||
<Column gap>
|
||||
{onClose && (
|
||||
<Row justifyContent="flex-end">
|
||||
<Button onPress={onClose} variant="quiet">
|
||||
<Icon>
|
||||
<X />
|
||||
</Icon>
|
||||
</Button>
|
||||
</Row>
|
||||
)}
|
||||
<Column gap="6">
|
||||
<Row justifyContent="center" alignItems="center" gap="6">
|
||||
<Avatar seed={data?.id} size={128} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue