diff --git a/packages/frontend/src/components/projects/ProjectCard.tsx b/packages/frontend/src/components/projects/ProjectCard.tsx index 2e8719fd..fa312696 100644 --- a/packages/frontend/src/components/projects/ProjectCard.tsx +++ b/packages/frontend/src/components/projects/ProjectCard.tsx @@ -1,6 +1,13 @@ import React from 'react'; import { Link } from 'react-router-dom'; +import { + Menu, + MenuHandler, + MenuList, + MenuItem, +} from '@material-tailwind/react'; + import { relativeTime } from '../../utils/time'; import { ProjectDetails } from '../../types/project'; @@ -19,7 +26,15 @@ const ProjectCard: React.FC = ({ project }) => {

{project.domain}

-
...
+ + + + + + ^ Project settings + ^ Delete project + +

{project.latestCommit.message}

diff --git a/packages/frontend/src/components/ConnectAccount.tsx b/packages/frontend/src/components/projects/create/ConnectAccount.tsx similarity index 100% rename from packages/frontend/src/components/ConnectAccount.tsx rename to packages/frontend/src/components/projects/create/ConnectAccount.tsx diff --git a/packages/frontend/src/components/ProjectRepoCard.tsx b/packages/frontend/src/components/projects/create/ProjectRepoCard.tsx similarity index 91% rename from packages/frontend/src/components/ProjectRepoCard.tsx rename to packages/frontend/src/components/projects/create/ProjectRepoCard.tsx index c61decd5..3aa1b305 100644 --- a/packages/frontend/src/components/ProjectRepoCard.tsx +++ b/packages/frontend/src/components/projects/create/ProjectRepoCard.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { relativeTime } from '../utils/time'; +import { relativeTime } from '../../../utils/time'; interface RepositoryDetails { title: string; diff --git a/packages/frontend/src/components/RepositoryList.tsx b/packages/frontend/src/components/projects/create/RepositoryList.tsx similarity index 60% rename from packages/frontend/src/components/RepositoryList.tsx rename to packages/frontend/src/components/projects/create/RepositoryList.tsx index 9ee678e8..cecd0fa8 100644 --- a/packages/frontend/src/components/RepositoryList.tsx +++ b/packages/frontend/src/components/projects/create/RepositoryList.tsx @@ -1,18 +1,25 @@ import React from 'react'; -import SearchBar from './SearchBar'; +import SearchBar from '../../SearchBar'; import ProjectRepoCard from './ProjectRepoCard'; -import repositoryDetails from '../assets/repositories.json'; +import repositoryDetails from '../../../assets/repositories.json'; +import Dropdown from '../../Dropdown'; + +const ACCOUNT_OPTIONS = [ + { value: 'alice', label: 'Alice' }, + { value: 'bob', label: 'Bob' }, + { value: 'charlie', label: 'Charlie' }, +]; const RepositoryList = () => { return (
- {}} />
diff --git a/packages/frontend/src/components/TemplateCard.tsx b/packages/frontend/src/components/projects/create/TemplateCard.tsx similarity index 100% rename from packages/frontend/src/components/TemplateCard.tsx rename to packages/frontend/src/components/projects/create/TemplateCard.tsx diff --git a/packages/frontend/src/components/projects/create/template/deploy/CancelDeploymentDialog.tsx b/packages/frontend/src/components/projects/create/template/deploy/CancelDeploymentDialog.tsx new file mode 100644 index 00000000..e3ab096c --- /dev/null +++ b/packages/frontend/src/components/projects/create/template/deploy/CancelDeploymentDialog.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; + +import { + Button, + Dialog, + DialogHeader, + DialogBody, + DialogFooter, +} from '@material-tailwind/react'; + +interface CancelDeploymentDialogProp { + open: boolean; + handleOpen: () => void; +} + +const CancelDeploymentDialog = ({ + open, + handleOpen, +}: CancelDeploymentDialogProp) => { + return ( + + +
Cancel deployment?
+ +
+ + This will halt the deployment and you will have to start the process + from scratch. + + + + + + + +
+ ); +}; + +export default CancelDeploymentDialog; diff --git a/packages/frontend/src/components/DeployStep.tsx b/packages/frontend/src/components/projects/create/template/deploy/DeployStep.tsx similarity index 93% rename from packages/frontend/src/components/DeployStep.tsx rename to packages/frontend/src/components/projects/create/template/deploy/DeployStep.tsx index a0aacc83..82385cbb 100644 --- a/packages/frontend/src/components/DeployStep.tsx +++ b/packages/frontend/src/components/projects/create/template/deploy/DeployStep.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; -import { Stopwatch, setStopWatchOffset } from './StopWatch'; -import FormatMillisecond from './FormatMilliSecond'; +import { Stopwatch, setStopWatchOffset } from '../../../../StopWatch'; +import FormatMillisecond from '../../../../FormatMilliSecond'; const PROCESS_LOGS = [ 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', diff --git a/packages/frontend/src/components/projects/project/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/DeploymentDetailsCard.tsx index fa6421dd..3da04051 100644 --- a/packages/frontend/src/components/projects/project/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/DeploymentDetailsCard.tsx @@ -1,5 +1,12 @@ import React from 'react'; +import { + Menu, + MenuHandler, + MenuList, + MenuItem, +} from '@material-tailwind/react'; + import { relativeTime } from '../../../utils/time'; interface DeploymentDetails { @@ -39,7 +46,19 @@ const DeployDetailsCard = ({ deployment }: DeployDetailsCardProps) => {

{relativeTime(deployment.updatedAt)} ^ {deployment.author}

- + + + + + + ^ Visit + ^ Assign domain + ^ Change to production +
+ ^ Redeploy + ^ Rollback to this version +
+
); diff --git a/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx b/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx index 98ca4f74..54294a6a 100644 --- a/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx +++ b/packages/frontend/src/components/projects/project/DeploymentsTabPanel.tsx @@ -5,8 +5,9 @@ import DeployDetailsCard from './DeploymentDetailsCard'; import Dropdown from '../../Dropdown'; const STATUS_OPTIONS = [ - { value: 'production', label: 'Production' }, - { value: 'preview', label: 'Preview' }, + { value: 'building', label: 'Building' }, + { value: 'ready', label: 'Ready' }, + { value: 'error', label: 'Error' }, ]; const DeploymentsTabPanel = () => { diff --git a/packages/frontend/src/pages/projects/create/index.tsx b/packages/frontend/src/pages/projects/create/index.tsx index 524c70fb..033ca973 100644 --- a/packages/frontend/src/pages/projects/create/index.tsx +++ b/packages/frontend/src/pages/projects/create/index.tsx @@ -1,9 +1,9 @@ import React from 'react'; import templateDetails from '../../../assets/templates.json'; -import TemplateCard from '../../../components/TemplateCard'; -import RepositoryList from '../../../components/RepositoryList'; -import ConnectAccount from '../../../components/ConnectAccount'; +import TemplateCard from '../../../components/projects/create/TemplateCard'; +import RepositoryList from '../../../components/projects/create/RepositoryList'; +import ConnectAccount from '../../../components/projects/create/ConnectAccount'; const IS_GIT_AUTH = true; diff --git a/packages/frontend/src/pages/projects/create/template/Deploy.tsx b/packages/frontend/src/pages/projects/create/template/Deploy.tsx index ede4c8e2..ec2e8770 100644 --- a/packages/frontend/src/pages/projects/create/template/Deploy.tsx +++ b/packages/frontend/src/pages/projects/create/template/Deploy.tsx @@ -1,12 +1,21 @@ import React from 'react'; -import { DeployStep, DeployStatus } from '../../../../components/DeployStep'; +import { Button } from '@material-tailwind/react'; + +import { + DeployStep, + DeployStatus, +} from '../../../../components/projects/create/template/deploy/DeployStep'; import { Stopwatch, setStopWatchOffset, } from '../../../../components/StopWatch'; +import CancelDeploymentDialog from '../../../../components/projects/create/template/deploy/CancelDeploymentDialog'; const Deploy = () => { + const [open, setOpen] = React.useState(false); + const handleOpen = () => setOpen(!open); + return (
@@ -20,8 +29,11 @@ const Deploy = () => {
- +
+