Reworked settings screens.

This commit is contained in:
Mike Cao 2025-05-03 00:31:37 -07:00
parent c1d301ffdc
commit 0a16ab38e4
58 changed files with 362 additions and 365 deletions

View file

@ -46,9 +46,9 @@ export function DataGrid({
};
return (
<>
<Column gap="4">
{allowSearch && (hasData || search) && (
<Row width="280px" alignItems="center" marginBottom="6">
<Row width="280px" alignItems="center">
<SearchField
value={search}
onSearch={handleSearch}
@ -71,6 +71,6 @@ export function DataGrid({
</Row>
)}
</LoadingPanel>
</>
</Column>
);
}

View file

@ -5,6 +5,7 @@ import { useLocale } from '@/components/hooks';
export interface LinkButtonProps {
href: string;
target?: string;
scroll?: boolean;
variant?: any;
children?: ReactNode;
@ -12,8 +13,9 @@ export interface LinkButtonProps {
export function LinkButton({
href,
variant = 'quiet',
variant,
scroll = true,
target,
children,
...props
}: LinkButtonProps) {
@ -21,7 +23,7 @@ export function LinkButton({
return (
<Button {...props} variant={variant} asChild>
<Link href={href} dir={dir} scroll={scroll}>
<Link href={href} dir={dir} scroll={scroll} target={target}>
{children}
</Link>
</Button>

View file

@ -1,10 +0,0 @@
.page {
flex: 1;
display: flex;
flex-direction: column;
position: relative;
width: 100%;
max-width: 1320px;
margin: 0 auto;
padding: 0 20px;
}

View file

@ -1,48 +0,0 @@
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
align-content: center;
align-self: stretch;
flex-wrap: wrap;
height: 100px;
}
.header a {
color: var(--base600);
}
.header a:hover {
color: var(--base900);
}
.title {
display: flex;
align-items: center;
font-size: 24px;
font-weight: 700;
gap: 20px;
height: 60px;
flex: 1;
}
.breadcrumb {
padding-top: 20px;
}
.icon {
color: var(--base700);
margin-inline-end: 1rem;
}
.actions {
display: flex;
justify-content: flex-end;
}
@media only screen and (max-width: 992px) {
.header {
margin-bottom: 10px;
}
}

View file

@ -15,10 +15,10 @@ export function PageHeader({
children?: ReactNode;
}) {
return (
<Row justifyContent="space-between" alignItems="center" marginY="6">
<Row justifyContent="space-between" alignItems="center" paddingY="6" border="bottom">
<Row gap="3">
{icon && <Icon size="lg">{icon}</Icon>}
{title && <Heading size="2">{title}</Heading>}
{icon && <Icon>{icon}</Icon>}
{title && <Heading size="4">{title}</Heading>}
{description && <Text color="muted">{description}</Text>}
</Row>
<Row justifyContent="flex-end">{children}</Row>

View file

@ -1,32 +0,0 @@
.pager {
display: grid;
grid-template-columns: repeat(3, 1fr);
align-items: center;
}
.nav {
display: flex;
align-items: center;
justify-content: center;
}
.text {
font-size: var(--font-size-md);
margin: 0 16px;
justify-content: center;
}
.count {
color: var(--base600);
font-weight: 700;
}
@media only screen and (max-width: 992px) {
.pager {
grid-template-columns: repeat(2, 1fr);
}
.nav {
justify-content: flex-end;
}
}

View file

@ -0,0 +1,27 @@
import { ReactNode } from 'react';
import { Heading, Icon, Row, Text } from '@umami/react-zen';
export function SectionHeader({
title,
description,
icon,
children,
}: {
title: string;
description?: string;
icon?: ReactNode;
allowEdit?: boolean;
className?: string;
children?: ReactNode;
}) {
return (
<Row justifyContent="space-between" alignItems="center" height="60px">
<Row gap="3" alignItems="center">
{icon && <Icon>{icon}</Icon>}
{title && <Heading size="3">{title}</Heading>}
{description && <Text color="muted">{description}</Text>}
</Row>
<Row justifyContent="flex-end">{children}</Row>
</Row>
);
}

View file

@ -1,20 +0,0 @@
import { Text, List, ListItem } from '@umami/react-zen';
export interface MenuNavProps {
items: any[];
selectedKey?: string;
}
export function SideBar({ items, selectedKey }: MenuNavProps) {
return (
<List>
{items.map(({ key, label, url }) => {
return (
<ListItem key={key} href={url}>
<Text weight={key === selectedKey ? 'bold' : 'regular'}>{label}</Text>
</ListItem>
);
})}
</List>
);
}

View file

@ -0,0 +1,20 @@
import { Text, List, ListItem } from '@umami/react-zen';
export interface MenuNavProps {
items: { id: string; label: string; url: string }[];
selectedKey?: string;
}
export function SideMenu({ items, selectedKey }: MenuNavProps) {
return (
<List>
{items.map(({ id, label, url }) => {
return (
<ListItem key={id} id={id} href={url}>
<Text weight={id === selectedKey ? 'bold' : 'regular'}>{label}</Text>
</ListItem>
);
})}
</List>
);
}

View file

@ -106,7 +106,6 @@ export function DateFilter({
placeholder={formatMessage(labels.selectDate)}
onSelectionChange={handleChange}
renderValue={renderValue}
style={{ width: 'auto' }}
>
{options.map(({ label, value, divider }: any) => {
return (

View file

@ -22,7 +22,7 @@ export function ProfileButton() {
const handleSelect = (key: Key) => {
if (key === 'profile') {
router.push('/profile');
router.push('/settings/profile');
}
if (key === 'logout') {
router.push('/logout');

View file

@ -1,6 +1,6 @@
import { Button, Icon, DialogTrigger, Popover, Column, Label } from '@umami/react-zen';
import { TimezoneSetting } from '@/app/(main)/profile/TimezoneSetting';
import { DateRangeSetting } from '@/app/(main)/profile/DateRangeSetting';
import { TimezoneSetting } from '@/app/(main)/settings/profile/TimezoneSetting';
import { DateRangeSetting } from '@/app/(main)/settings/profile/DateRangeSetting';
import { Icons } from '@/components/icons';
import { useMessages } from '@/components/hooks';

View file

@ -79,6 +79,7 @@ export const labels = defineMessages({
realtime: { id: 'label.realtime', defaultMessage: 'Realtime' },
queries: { id: 'label.queries', defaultMessage: 'Queries' },
teams: { id: 'label.teams', defaultMessage: 'Teams' },
teamSettings: { id: 'label.team-settings', defaultMessage: 'Team settings' },
analytics: { id: 'label.analytics', defaultMessage: 'Analytics' },
login: { id: 'label.login', defaultMessage: 'Login' },
logout: { id: 'label.logout', defaultMessage: 'Logout' },

View file

@ -32,6 +32,7 @@ export { default as Profile } from './Profile';
export { default as Pushpin } from './Pushpin';
export { default as Redo } from './Redo';
export { default as Reports } from './Reports';
export { default as Security } from './Security';
export { default as Speaker } from './Speaker';
export { default as Sun } from './Sun';
export { default as Tag } from './Tag';