diff --git a/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx b/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx
index 44a285b..3607c6b 100644
--- a/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx
+++ b/packages/frontend/src/components/projects/project/settings/EditDomainDialog.tsx
@@ -1,6 +1,5 @@
import { useCallback, useEffect, useMemo } from 'react';
import { Controller, useForm, SubmitHandler } from 'react-hook-form';
-import toast from 'react-hot-toast';
import { Domain } from 'gql-client';
import {
@@ -9,10 +8,11 @@ import {
Option,
} from '@snowballtools/material-tailwind-react-fork';
-import { useGQLClient } from '../../../../context/GQLClientContext';
+import { useGQLClient } from 'context/GQLClientContext';
import { Modal } from 'components/shared/Modal';
import { Button } from 'components/shared/Button';
import { Input } from 'components/shared/Input';
+import { useToast } from 'components/shared/Toast';
const DEFAULT_REDIRECT_OPTIONS = ['none'];
@@ -40,6 +40,7 @@ const EditDomainDialog = ({
onUpdate,
}: EditDomainDialogProp) => {
const client = useGQLClient();
+ const { toast, dismiss } = useToast();
const getRedirectUrl = (domain: Domain) => {
const redirectDomain = domain.redirectTo;
@@ -99,10 +100,20 @@ const EditDomainDialog = ({
if (updateDomain) {
await onUpdate();
- toast.success(`Domain ${domain.name} has been updated`);
+ toast({
+ id: 'domain_id_updated',
+ title: `Domain ${domain.name} has been updated`,
+ variant: 'success',
+ onDismiss: dismiss,
+ });
} else {
reset();
- toast.error(`Error updating domain ${domain.name}`);
+ toast({
+ id: 'domain_id_error_update',
+ title: `Error updating domain ${domain.name}`,
+ variant: 'error',
+ onDismiss: dismiss,
+ });
}
handleOpen();
diff --git a/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx b/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx
index 145087a..24eedd1 100644
--- a/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx
+++ b/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx
@@ -3,6 +3,8 @@ import { useState } from 'react';
import { DeleteWebhookDialog } from 'components/projects/Dialog/DeleteWebhookDialog';
import { Button } from 'components/shared/Button';
import { useToast } from 'components/shared/Toast';
+import { Input } from 'components/shared/Input';
+import { CopyIcon, TrashIcon } from 'components/shared/CustomIcon';
interface WebhookCardProps {
webhookUrl: string;
@@ -14,11 +16,12 @@ const WebhookCard = ({ webhookUrl, onDelete }: WebhookCardProps) => {
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
return (
-
- {webhookUrl}
+
+
= {
+ title: 'Project/Settings/DomainCard',
+ component: DomainCard,
+ tags: ['autodocs'],
+ argTypes: {
+ domains: {
+ control: {
+ type: 'object',
+ },
+ },
+ domain: {
+ control: {
+ type: 'object',
+ },
+ },
+ branches: {
+ control: {
+ type: 'object',
+ },
+ },
+ project: {
+ control: {
+ type: 'object',
+ },
+ },
+ onUpdate: {
+ action: 'update',
+ },
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {
+ args: {
+ domains: [domain0, domain1],
+ domain: domain0,
+ branches: ['main'],
+ project: project,
+ },
+};
diff --git a/packages/frontend/src/stories/Project/Settings/EditDomainDialog.stories.tsx b/packages/frontend/src/stories/Project/Settings/EditDomainDialog.stories.tsx
new file mode 100644
index 0000000..8aa62cf
--- /dev/null
+++ b/packages/frontend/src/stories/Project/Settings/EditDomainDialog.stories.tsx
@@ -0,0 +1,43 @@
+import { StoryObj, Meta } from '@storybook/react';
+
+import EditDomainDialog from 'components/projects/project/settings/EditDomainDialog';
+
+const meta: Meta = {
+ title: 'Components/EditDomainDialog',
+ component: EditDomainDialog,
+ tags: ['autodocs'],
+ argTypes: {
+ domains: {
+ control: {
+ type: 'object',
+ },
+ },
+ open: {
+ control: {
+ type: 'boolean',
+ },
+ },
+ handleOpen: {
+ action: 'open',
+ },
+ domain: {
+ control: {
+ type: 'object',
+ },
+ },
+ branches: {
+ control: {
+ type: 'object',
+ },
+ },
+ onUpdate: {
+ action: 'update',
+ },
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {};
diff --git a/packages/frontend/src/stories/Project/Settings/WebhookCard.stories.tsx b/packages/frontend/src/stories/Project/Settings/WebhookCard.stories.tsx
new file mode 100644
index 0000000..c45d36a
--- /dev/null
+++ b/packages/frontend/src/stories/Project/Settings/WebhookCard.stories.tsx
@@ -0,0 +1,29 @@
+import { Meta, StoryObj } from '@storybook/react';
+
+import WebhookCard from 'components/projects/project/settings/WebhookCard';
+
+const meta: Meta = {
+ title: 'Project/Settings/WebhookCard',
+ component: WebhookCard,
+ tags: ['autodocs'],
+ argTypes: {
+ webhookUrl: {
+ control: {
+ type: 'text',
+ },
+ },
+ onDelete: {
+ action: 'delete',
+ },
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {
+ args: {
+ webhookUrl: 'https://api.retool.com',
+ },
+};