From 2d0de785f95574a411a490ecb565fe22a4cbb440 Mon Sep 17 00:00:00 2001 From: Vivian Phung Date: Sun, 12 May 2024 00:28:21 -0400 Subject: [PATCH] ui cleanup --- .../settings/AddEnvironmentVariableRow.tsx | 39 +++++++--------- .../project/settings/DeleteProjectDialog.tsx | 11 ++++- .../settings/DisplayEnvironmentVariables.tsx | 26 +++++------ .../projects/project/settings/DomainCard.tsx | 17 +++++-- .../settings/EditEnvironmentVariableRow.tsx | 4 +- .../project/settings/GitSelectionSection.tsx | 2 +- .../projects/project/settings/MemberCard.tsx | 10 ++--- .../projects/project/settings/WebhookCard.tsx | 5 +-- .../CustomIcon/ChevronDownSmallIcon.tsx | 20 +++++++++ .../shared/CustomIcon/ChevronUpSmallIcon.tsx | 20 +++++++++ .../src/components/shared/CustomIcon/index.ts | 2 + .../id/settings/EnvironmentVariables.tsx | 44 +++++++++---------- .../Icons/ChevronDownSmallIcon.stories.tsx | 25 +++++++++++ .../Icons/ChevronUpDown.stories.tsx | 2 +- .../Icons/ChevronUpSmallIcon.stories.tsx | 25 +++++++++++ 15 files changed, 176 insertions(+), 76 deletions(-) create mode 100644 packages/frontend/src/components/shared/CustomIcon/ChevronDownSmallIcon.tsx create mode 100644 packages/frontend/src/components/shared/CustomIcon/ChevronUpSmallIcon.tsx create mode 100644 packages/frontend/src/stories/Components/Icons/ChevronDownSmallIcon.stories.tsx create mode 100644 packages/frontend/src/stories/Components/Icons/ChevronUpSmallIcon.stories.tsx diff --git a/packages/frontend/src/components/projects/project/settings/AddEnvironmentVariableRow.tsx b/packages/frontend/src/components/projects/project/settings/AddEnvironmentVariableRow.tsx index 1611f984..31d9e5bb 100644 --- a/packages/frontend/src/components/projects/project/settings/AddEnvironmentVariableRow.tsx +++ b/packages/frontend/src/components/projects/project/settings/AddEnvironmentVariableRow.tsx @@ -1,10 +1,9 @@ import { UseFormRegister } from 'react-hook-form'; -import { Input } from 'components/shared/Input'; - import { EnvironmentVariablesFormValues } from '../../../../types'; import { Button } from 'components/shared/Button'; import { TrashIcon } from 'components/shared/CustomIcon'; +import { Input } from 'components/shared/Input'; interface AddEnvironmentVariableRowProps { onDelete: () => void; @@ -20,28 +19,24 @@ const AddEnvironmentVariableRow = ({ isDeleteDisabled, }: AddEnvironmentVariableRowProps) => { return ( -
-
- -
-
- -
+
+ +
- { setRemoveMemberDialogOpen((prevVal) => !prevVal); }} > D - +
)} diff --git a/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx b/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx index c0ecbf80..352856f6 100644 --- a/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx +++ b/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx @@ -1,9 +1,8 @@ import { useState } from 'react'; import toast from 'react-hot-toast'; -import { Button } from '@snowballtools/material-tailwind-react-fork'; - import { DeleteWebhookDialog } from 'components/projects/Dialog/DeleteWebhookDialog'; +import { Button } from 'components/shared/Button'; interface WebhookCardProps { webhookUrl: string; @@ -26,8 +25,8 @@ const WebhookCard = ({ webhookUrl, onDelete }: WebhookCardProps) => { C {/* TODO: Implement import environment varible functionality */} -
{isFieldEmpty && ( - )} -
+
{
- +
diff --git a/packages/frontend/src/stories/Components/Icons/ChevronDownSmallIcon.stories.tsx b/packages/frontend/src/stories/Components/Icons/ChevronDownSmallIcon.stories.tsx new file mode 100644 index 00000000..b2cb4329 --- /dev/null +++ b/packages/frontend/src/stories/Components/Icons/ChevronDownSmallIcon.stories.tsx @@ -0,0 +1,25 @@ +import { Meta, StoryObj } from '@storybook/react'; + +import { ChevronDownSmallIcon } from 'components/shared/CustomIcon'; + +const meta: Meta = { + title: 'Icons/ChevronDownSmallIcon', + component: ChevronDownSmallIcon, + tags: ['autodocs'], + args: { + size: 'string | number' as unknown as any, + name: 'string', + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: ({ size, name }) => , + args: { + size: '24px', + name: 'plus', + }, +}; diff --git a/packages/frontend/src/stories/Components/Icons/ChevronUpDown.stories.tsx b/packages/frontend/src/stories/Components/Icons/ChevronUpDown.stories.tsx index 2b7a692c..f9c5ce01 100644 --- a/packages/frontend/src/stories/Components/Icons/ChevronUpDown.stories.tsx +++ b/packages/frontend/src/stories/Components/Icons/ChevronUpDown.stories.tsx @@ -1,6 +1,6 @@ import { Meta, StoryObj } from '@storybook/react'; -import { ChevronUpDown } from 'components/shared/CustomIcon/ChevronUpDown'; +import { ChevronUpDown } from 'components/shared/CustomIcon'; const meta: Meta = { title: 'Icons/ChevronUpDown', diff --git a/packages/frontend/src/stories/Components/Icons/ChevronUpSmallIcon.stories.tsx b/packages/frontend/src/stories/Components/Icons/ChevronUpSmallIcon.stories.tsx new file mode 100644 index 00000000..cbe2a93a --- /dev/null +++ b/packages/frontend/src/stories/Components/Icons/ChevronUpSmallIcon.stories.tsx @@ -0,0 +1,25 @@ +import { Meta, StoryObj } from '@storybook/react'; + +import { ChevronUpSmallIcon } from 'components/shared/CustomIcon'; + +const meta: Meta = { + title: 'Components/ChevronUpSmallIcon', + component: ChevronUpSmallIcon, + tags: ['autodocs'], + args: { + size: 'string | number' as unknown as any, + name: 'string', + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: ({ size, name }) => , + args: { + size: '24px', + name: 'chevron-up', + }, +};