From dbed5530b53aa0357ebb2a1db91bc0432f1141fa Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 20 Jun 2022 16:58:32 -0230 Subject: [PATCH] Start PausedProjectState layout --- .../Home/ProjectList/ProjectCard.tsx | 28 +++++------ .../ProjectLayout/ProjectPausedState.tsx | 48 +++++++++++++++++++ studio/components/ui/CardButton.tsx | 20 ++++---- studio/pages/project/[ref]/index.tsx | 8 +++- 4 files changed, 79 insertions(+), 25 deletions(-) create mode 100644 studio/components/layouts/ProjectLayout/ProjectPausedState.tsx diff --git a/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx index 1ce7813ed16..447810fb6b5 100644 --- a/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx +++ b/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx @@ -19,16 +19,23 @@ const ProjectCard: FC = ({ onSelectDelete, rewriteHref, }) => { + console.log({ rewriteHref }) const { name, ref: projectRef } = project const desc = `${project.cloud_provider} | ${project.region}` return (
  • - {name} +
    + {name} +
    + } + description={''} + footer={ +
    + {desc} {paused && (
    @@ -39,15 +46,9 @@ const ProjectCard: FC = ({
    )} -
    - } - description={''} - footer={ -
    - {desc} - {paused && ( -
    -
    + + {/*
    +
    -
    - )} +
    */}
    } > diff --git a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx new file mode 100644 index 00000000000..45aa0b1b87e --- /dev/null +++ b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx @@ -0,0 +1,48 @@ +import { FC } from 'react' +import { observer } from 'mobx-react-lite' +import { Badge, IconLoader, IconMonitor, IconServer } from '@supabase/ui' + +import { Project } from 'types' + +// interface Props { +// project: Project +// } + +//const ProjectPausedState: FC = ({ project }) => { +const ProjectPausedState = () => { + return ( + <> +
    +
    +
    +

    PROJECT NAME

    +
    + +
    + + Connecting to project +
    +
    +
    +
    +
    +
    +
    + + +
    + +
    +

    Connecting to PROJECT NAME

    +
    + +
    +
    +
    +
    +
    + + ) +} + +export default observer(ProjectPausedState) diff --git a/studio/components/ui/CardButton.tsx b/studio/components/ui/CardButton.tsx index 2fff53a667a..afeeff659fd 100644 --- a/studio/components/ui/CardButton.tsx +++ b/studio/components/ui/CardButton.tsx @@ -27,7 +27,7 @@ const CardButton: FC = ({ imgAlt, onClick, icon, - containerHeightClassName="h-32" + containerHeightClassName = 'h-32', }) => { const LinkContainer = ({ children }: { children: React.ReactNode }) => ( @@ -48,7 +48,7 @@ const CardButton: FC = ({ 'border border-panel-border-light dark:border-panel-border-dark', 'rounded-md py-4 px-6 flex flex-row', 'transition ease-in-out duration-150', - containerHeightClassName + containerHeightClassName, ] if (isLink) { @@ -62,7 +62,7 @@ const CardButton: FC = ({ } const ImageContainer = ({ children }: { children: React.ReactNode }) => { - return
    {children}
    + return
    {children}
    } const contents = ( @@ -81,9 +81,9 @@ const CardButton: FC = ({ )} {icon && {icon}} -
    +
    {title}
    -
    +

    {description}

    {children && children}
    @@ -92,14 +92,14 @@ const CardButton: FC = ({ {isLink && (
    diff --git a/studio/pages/project/[ref]/index.tsx b/studio/pages/project/[ref]/index.tsx index eba3af89bf4..caa45c32d0e 100644 --- a/studio/pages/project/[ref]/index.tsx +++ b/studio/pages/project/[ref]/index.tsx @@ -7,11 +7,14 @@ import { IS_PLATFORM } from 'lib/constants' import { ProjectLayoutWithAuth } from 'components/layouts' import ProjectUsageSection from 'components/interfaces/Home/ProjectUsageSection' import { NextPageWithLayout } from 'types' +import { toJS } from 'mobx' +import ProjectPausedState from 'components/layouts/ProjectLayout/ProjectPausedState' const Home: NextPageWithLayout = () => { const { ui } = useStore() const project = ui.selectedProject + console.log(toJS(project)) const projectName = project?.ref !== 'default' && project?.name !== undefined ? project?.name @@ -22,7 +25,10 @@ const Home: NextPageWithLayout = () => {

    {projectName}

    - {IS_PLATFORM && } + + {project && project?.status == 'INACTIVE' &&

    hello everyone

    } + + {/* {IS_PLATFORM && project?.status !== 'INACTIVE' && } */}
    Client libraries