diff --git a/packages/frontend/src/components/projects/project/settings/ProjectSettingContainer.tsx b/packages/frontend/src/components/projects/project/settings/ProjectSettingContainer.tsx new file mode 100644 index 00000000..4d2ae098 --- /dev/null +++ b/packages/frontend/src/components/projects/project/settings/ProjectSettingContainer.tsx @@ -0,0 +1,32 @@ +import { PropsWithChildren } from 'react'; + +import { ProjectSettingHeader } from './ProjectSettingHeader'; + +export interface ProjectSettingContainerProps extends PropsWithChildren { + headingText: string; + className?: string; + button?: React.ReactNode; + badge?: React.ReactNode; +} + +const ProjectSettingContainer: React.FC = ({ + headingText, + className, + button, + children, + badge, + ...props +}: ProjectSettingContainerProps) => { + return ( +
+ + {children} +
+ ); +}; + +export { ProjectSettingContainer }; diff --git a/packages/frontend/src/components/projects/project/settings/ProjectSettingHeader.tsx b/packages/frontend/src/components/projects/project/settings/ProjectSettingHeader.tsx new file mode 100644 index 00000000..f2229cc4 --- /dev/null +++ b/packages/frontend/src/components/projects/project/settings/ProjectSettingHeader.tsx @@ -0,0 +1,30 @@ +import { PropsWithChildren } from 'react'; + +import { Heading } from 'components/shared/Heading'; + +export interface ProjectSettingHeaderProps extends PropsWithChildren { + headingText: string; + button?: React.ReactNode; + badge?: React.ReactNode; +} + +const ProjectSettingHeader: React.FC = ({ + headingText, + button, + badge, + ...props +}) => { + return ( +
+
+ + {headingText} + + {badge} +
+ {button ?? button} +
+ ); +}; + +export { ProjectSettingHeader }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/Collaborators.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/Collaborators.tsx index 9a343a34..e28a56b5 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/Collaborators.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/Collaborators.tsx @@ -6,11 +6,11 @@ import MemberCard from 'components/projects/project/settings/MemberCard'; import AddMemberDialog from 'components/projects/project/settings/AddMemberDialog'; import { useGQLClient } from '../../../../../context/GQLClientContext'; import { OutletContextType } from '../../../../../types'; -import { useToast } from 'components/shared/Toast'; +import { useToast } from '../../../../../components/shared/Toast'; import { Button } from 'components/shared/Button'; import { PlusIcon } from 'components/shared/CustomIcon'; import { Badge } from 'components/shared/Badge'; -import { Heading } from 'components/shared/Heading'; +import { ProjectSettingContainer } from 'components/projects/project/settings/ProjectSettingContainer'; const FIRST_MEMBER_CARD = 0; @@ -105,16 +105,14 @@ const CollaboratorsTabPanel = () => { }, [project.id, fetchProjectMembers]); return ( -
-
-
- - Collaborators - - - {projectMembers.length + 1} - -
+ + {projectMembers.length + 1} + + } + button={ -
+ } + > { open={addmemberDialogOpen} handleAddMember={addMemberHandler} /> -
+ ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/Domains.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/Domains.tsx index 11039d0e..0de97ac0 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/Domains.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/Domains.tsx @@ -7,8 +7,9 @@ import DomainCard from 'components/projects/project/settings/DomainCard'; import { useGQLClient } from '../../../../../context/GQLClientContext'; import { OutletContextType } from '../../../../../types'; import { useOctokit } from '../../../../../context/OctokitContext'; -import { Heading } from 'components/shared/Heading'; import { Button } from 'components/shared/Button'; +import { PlusIcon } from 'components/shared/CustomIcon'; +import { ProjectSettingContainer } from 'components/projects/project/settings/ProjectSettingContainer'; const Domains = () => { const client = useGQLClient(); @@ -57,16 +58,20 @@ const Domains = () => { }, []); return ( - <> -
- - Domains - - -
- + } + > {domains.map((domain) => { return ( { /> ); })} - + ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariables.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariables.tsx index 4f07241f..7975bd18 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariables.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/EnvironmentVariables.tsx @@ -16,6 +16,7 @@ import { Button } from 'components/shared/Button'; import { Checkbox } from 'components/shared/Checkbox'; import { PlusIcon } from 'components/shared/CustomIcon'; import { InlineNotification } from 'components/shared/InlineNotification'; +import { ProjectSettingContainer } from 'components/projects/project/settings/ProjectSettingContainer'; export const EnvironmentVariablesTabPanel = () => { const { id } = useParams(); @@ -130,10 +131,7 @@ export const EnvironmentVariablesTabPanel = () => { ); return ( -
- - Environment variables - +

A new deployment is required for your changes to take effect.

@@ -236,6 +234,6 @@ export const EnvironmentVariablesTabPanel = () => { }} />
- + ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/General.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/General.tsx index b6e31c9a..25302ae8 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/General.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/General.tsx @@ -12,6 +12,7 @@ import { Button } from 'components/shared/Button'; import { Select, SelectOption } from 'components/shared/Select'; import { TrashIcon, CopyUnfilledIcon } from 'components/shared/CustomIcon'; import { useToast } from 'components/shared/Toast'; +import { ProjectSettingContainer } from 'components/projects/project/settings/ProjectSettingContainer'; const GeneralTabPanel = () => { const client = useGQLClient(); @@ -109,7 +110,7 @@ const GeneralTabPanel = () => { }, [project]); return ( -
+
{ const { updateProject } = await client.updateProject(project.id, { @@ -120,11 +121,8 @@ const GeneralTabPanel = () => { await onUpdate(); } })} - className="self-stretch space-y-3 px-2" + className="self-stretch space-y-3" > - - Project Info - { project={project} />
- + ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/Git.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/Git.tsx index b753b7ad..325d0923 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/Git.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/Git.tsx @@ -8,8 +8,9 @@ import { OutletContextType } from '../../../../../types'; import { Button } from 'components/shared/Button'; import { Input } from 'components/shared/Input'; import { Switch } from 'components/shared/Switch'; -import { Heading } from 'components/shared/Heading'; import { useToast } from 'components/shared/Toast'; +import { ProjectSettingContainer } from 'components/projects/project/settings/ProjectSettingContainer'; +import { ProjectSettingHeader } from 'components/projects/project/settings/ProjectSettingHeader'; type UpdateProdBranchValues = { prodBranch: string; @@ -134,12 +135,8 @@ const GitTabPanel = () => { }; return ( -
-
- - Git repository - - + +

@@ -171,11 +168,9 @@ const GitTabPanel = () => { - - Production branch - +

By default, each commit pushed to the{' '} {project.prodBranch} branch @@ -193,11 +188,9 @@ const GitTabPanel = () => { - - Deploy webhooks - +

{' '} Webhooks configured to trigger when there is a change in a @@ -228,7 +221,7 @@ const GitTabPanel = () => { ); })}

-
+ ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/Config.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/Config.tsx index e22abfa7..3bc0ae67 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/Config.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/Config.tsx @@ -2,11 +2,11 @@ import toast from 'react-hot-toast'; import { useNavigate, useParams, useSearchParams } from 'react-router-dom'; import { useGQLClient } from '../../../../../../../context/GQLClientContext'; -import { Heading } from 'components/shared/Heading'; import { Table } from 'components/shared/Table'; import { Button } from 'components/shared/Button'; import { InlineNotification } from 'components/shared/InlineNotification'; import { ArrowRightCircleIcon } from 'components/shared/CustomIcon'; +import { ProjectSettingContainer } from 'components/projects/project/settings/ProjectSettingContainer'; const Config = () => { const { id, orgSlug } = useParams(); @@ -40,18 +40,13 @@ const Config = () => { // TODO: Figure out DNS Provider if possible and update appropriatly return ( -
-
- - Setup domain name - -

- Add the following records to your domain.  - - Go to NameCheap - -

-
+ +

+ Add the following records to your domain.  + + Go to NameCheap + +

@@ -90,7 +85,7 @@ const Config = () => { > Finish - + ); }; diff --git a/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/index.tsx b/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/index.tsx index e2b6708c..12afcc96 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/index.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/settings/domains/add/index.tsx @@ -5,7 +5,7 @@ import { IconButton, } from '@snowballtools/material-tailwind-react-fork'; -import Stepper from '../../../../../../../components/Stepper'; +import Stepper from 'components/Stepper'; const AddDomain = () => { const { id, orgSlug } = useParams();