Refactored icons.

This commit is contained in:
Mike Cao
2025-05-27 00:50:28 -07:00
parent 18eceee4c4
commit 99330a1a4d
86 changed files with 310 additions and 273 deletions

View File

@@ -1,7 +1,7 @@
import { Button, MenuTrigger, Dialog, Icon, Text, Modal } from '@umami/react-zen';
import { useMessages } from '@/components/hooks';
import { GoalAddForm } from './GoalAddForm';
import { Icons } from '@/components/icons';
import { Plus } from '@/components/icons';
export function GoalAddButton({ websiteId }: { websiteId: string }) {
const { formatMessage, labels } = useMessages();
@@ -10,7 +10,7 @@ export function GoalAddButton({ websiteId }: { websiteId: string }) {
<MenuTrigger>
<Button variant="primary">
<Icon>
<Icons.Plus />
<Plus />
</Icon>
<Text>{formatMessage(labels.addGoal)}</Text>
</Button>

View File

@@ -9,7 +9,15 @@ import {
} from '@umami/react-zen';
import { useApi, useMessages } from '@/components/hooks';
export function GoalAddForm({ onSave, onClose }: { onSave?: () => void; onClose?: () => void }) {
export function GoalAddForm({
websiteId,
onSave,
onClose,
}: {
websiteId: string;
onSave?: () => void;
onClose?: () => void;
}) {
const { formatMessage, labels } = useMessages();
const { post, useMutation } = useApi();
const { mutate, error, isPending } = useMutation({
@@ -32,6 +40,7 @@ export function GoalAddForm({ onSave, onClose }: { onSave?: () => void; onClose?
return (
<Form onSubmit={handleSubmit} error={error?.message}>
{websiteId}
<FormField
name="name"
label={formatMessage(labels.name)}