diff --git a/airbyte-webapp/public/empty-connections.png b/airbyte-webapp/public/empty-connections.png new file mode 100644 index 000000000000..c7db3d284e02 Binary files /dev/null and b/airbyte-webapp/public/empty-connections.png differ diff --git a/airbyte-webapp/public/empty-destinations.png b/airbyte-webapp/public/empty-destinations.png new file mode 100644 index 000000000000..a909cf38f865 Binary files /dev/null and b/airbyte-webapp/public/empty-destinations.png differ diff --git a/airbyte-webapp/public/empty-sources.png b/airbyte-webapp/public/empty-sources.png new file mode 100644 index 000000000000..9377bde91cf5 Binary files /dev/null and b/airbyte-webapp/public/empty-sources.png differ diff --git a/airbyte-webapp/src/components/Placeholder/Placeholder.tsx b/airbyte-webapp/src/components/Placeholder/Placeholder.tsx new file mode 100644 index 000000000000..fb92c2c38d4c --- /dev/null +++ b/airbyte-webapp/src/components/Placeholder/Placeholder.tsx @@ -0,0 +1,27 @@ +import React from "react"; +import styled from "styled-components"; +import { ResourceTypes } from "./types"; + +type PlaceholderProps = { + resource: ResourceTypes; +}; + +const Img = styled.img` + max-height: ${({ resource }) => + resource === ResourceTypes.Connections + ? "465" + : resource === ResourceTypes.Destinations + ? "409" + : "534"}px; + max-width: 100%; + margin: 100px auto 0; + display: block; +`; + +const Placeholder: React.FC = ({ resource }) => { + return ( + placeholder + ); +}; + +export default Placeholder; diff --git a/airbyte-webapp/src/components/Placeholder/index.tsx b/airbyte-webapp/src/components/Placeholder/index.tsx new file mode 100644 index 000000000000..8d62ab7db648 --- /dev/null +++ b/airbyte-webapp/src/components/Placeholder/index.tsx @@ -0,0 +1,5 @@ +import Placeholder from "./Placeholder"; +import { ResourceTypes } from "./types"; + +export default Placeholder; +export { Placeholder, ResourceTypes }; diff --git a/airbyte-webapp/src/components/Placeholder/types.ts b/airbyte-webapp/src/components/Placeholder/types.ts new file mode 100644 index 000000000000..7e3be47d5231 --- /dev/null +++ b/airbyte-webapp/src/components/Placeholder/types.ts @@ -0,0 +1,5 @@ +export enum ResourceTypes { + Sources = "sources", + Connections = "connections", + Destinations = "destinations", +} diff --git a/airbyte-webapp/src/pages/ConnectionPage/pages/AllConnectionsPage/AllConnectionsPage.tsx b/airbyte-webapp/src/pages/ConnectionPage/pages/AllConnectionsPage/AllConnectionsPage.tsx index 306a5a07ee39..8be29a8876a8 100644 --- a/airbyte-webapp/src/pages/ConnectionPage/pages/AllConnectionsPage/AllConnectionsPage.tsx +++ b/airbyte-webapp/src/pages/ConnectionPage/pages/AllConnectionsPage/AllConnectionsPage.tsx @@ -1,26 +1,15 @@ import React, { Suspense } from "react"; import { FormattedMessage } from "react-intl"; import { useResource } from "rest-hooks"; -import styled from "styled-components"; -import { - Button, - MainPageWithScroll, - PageTitle, - LoadingPage, - ContentCard, -} from "components"; +import { Button, MainPageWithScroll, PageTitle, LoadingPage } from "components"; import ConnectionResource from "core/resources/Connection"; import config from "config"; import ConnectionsTable from "./components/ConnectionsTable"; import { Routes } from "pages/routes"; import useRouter from "components/hooks/useRouterHook"; -import EmptyResource from "components/EmptyResourceBlock"; import HeadTitle from "components/HeadTitle"; - -const Content = styled(ContentCard)` - margin: 0 32px 0 27px; -`; +import Placeholder, { ResourceTypes } from "components/Placeholder"; const AllConnectionsPage: React.FC = () => { const { push } = useRouter(); @@ -49,11 +38,7 @@ const AllConnectionsPage: React.FC = () => { {connections.length ? ( ) : ( - - } - /> - + )} diff --git a/airbyte-webapp/src/pages/DestinationPage/pages/AllDestinationsPage/AllDestinationsPage.tsx b/airbyte-webapp/src/pages/DestinationPage/pages/AllDestinationsPage/AllDestinationsPage.tsx index dc3ae1753eee..2bef3bd15309 100644 --- a/airbyte-webapp/src/pages/DestinationPage/pages/AllDestinationsPage/AllDestinationsPage.tsx +++ b/airbyte-webapp/src/pages/DestinationPage/pages/AllDestinationsPage/AllDestinationsPage.tsx @@ -1,22 +1,16 @@ import React from "react"; import { FormattedMessage } from "react-intl"; -import styled from "styled-components"; import { useResource } from "rest-hooks"; -import { Button } from "components"; +import { Button, MainPageWithScroll } from "components"; import { Routes } from "../../../routes"; import PageTitle from "components/PageTitle"; import useRouter from "components/hooks/useRouterHook"; import DestinationsTable from "./components/DestinationsTable"; import config from "config"; -import ContentCard from "components/ContentCard"; -import EmptyResource from "components/EmptyResourceBlock"; import DestinationResource from "core/resources/Destination"; import HeadTitle from "components/HeadTitle"; - -const Content = styled(ContentCard)` - margin: 0 32px 0 27px; -`; +import Placeholder, { ResourceTypes } from "components/Placeholder"; const AllDestinationsPage: React.FC = () => { const { push } = useRouter(); @@ -29,26 +23,25 @@ const AllDestinationsPage: React.FC = () => { push(`${Routes.Destination}${Routes.DestinationNew}`); return ( - <> - - } - endComponent={ - - } - /> + } + pageTitle={ + } + endComponent={ + + } + /> + } + > {destinations.length ? ( ) : ( - - } - /> - + )} - + ); }; diff --git a/airbyte-webapp/src/pages/DestinationPage/pages/DestinationItemPage/DestinationItemPage.tsx b/airbyte-webapp/src/pages/DestinationPage/pages/DestinationItemPage/DestinationItemPage.tsx index 9d59b9b236ea..4bca3c90be24 100644 --- a/airbyte-webapp/src/pages/DestinationPage/pages/DestinationItemPage/DestinationItemPage.tsx +++ b/airbyte-webapp/src/pages/DestinationPage/pages/DestinationItemPage/DestinationItemPage.tsx @@ -1,13 +1,11 @@ import React, { Suspense, useMemo, useState } from "react"; import { FormattedMessage } from "react-intl"; -import styled from "styled-components"; import { useResource } from "rest-hooks"; import PageTitle from "components/PageTitle"; import useRouter from "components/hooks/useRouterHook"; import config from "config"; -import ContentCard from "components/ContentCard"; -import EmptyResource from "components/EmptyResourceBlock"; +import Placeholder, { ResourceTypes } from "components/Placeholder"; import ConnectionResource from "core/resources/Connection"; import { Routes } from "../../../routes"; import Breadcrumbs from "components/Breadcrumbs"; @@ -28,10 +26,6 @@ import ImageBlock from "components/ImageBlock"; import SourceDefinitionResource from "core/resources/SourceDefinition"; import HeadTitle from "components/HeadTitle"; -const Content = styled(ContentCard)` - margin: 0 32px 0 27px; -`; - const DestinationItemPage: React.FC = () => { const { query, push } = useRouter<{ id: string }>(); @@ -140,14 +134,7 @@ const DestinationItemPage: React.FC = () => { connections={connectionsWithDestination} /> ) : ( - - } - description={ - - } - /> - + )} ); diff --git a/airbyte-webapp/src/pages/SourcesPage/pages/AllSourcesPage/AllSourcesPage.tsx b/airbyte-webapp/src/pages/SourcesPage/pages/AllSourcesPage/AllSourcesPage.tsx index 0c2c56ec9987..04e3262dab60 100644 --- a/airbyte-webapp/src/pages/SourcesPage/pages/AllSourcesPage/AllSourcesPage.tsx +++ b/airbyte-webapp/src/pages/SourcesPage/pages/AllSourcesPage/AllSourcesPage.tsx @@ -1,22 +1,16 @@ import React from "react"; import { FormattedMessage } from "react-intl"; -import styled from "styled-components"; import { useResource } from "rest-hooks"; -import { Button } from "components"; +import { Button, MainPageWithScroll } from "components"; import { Routes } from "../../../routes"; import PageTitle from "components/PageTitle"; import useRouter from "components/hooks/useRouterHook"; import SourcesTable from "./components/SourcesTable"; import config from "config"; -import ContentCard from "components/ContentCard"; -import EmptyResource from "components/EmptyResourceBlock"; import SourceResource from "core/resources/Source"; import HeadTitle from "components/HeadTitle"; - -const Content = styled(ContentCard)` - margin: 0 32px 0 27px; -`; +import Placeholder, { ResourceTypes } from "components/Placeholder"; const AllSourcesPage: React.FC = () => { const { push } = useRouter(); @@ -27,24 +21,25 @@ const AllSourcesPage: React.FC = () => { const onCreateSource = () => push(`${Routes.Source}${Routes.SourceNew}`); return ( - <> - - } - endComponent={ - - } - /> + } + pageTitle={ + } + endComponent={ + + } + /> + } + > {sources.length ? ( ) : ( - - } /> - + )} - + ); }; diff --git a/airbyte-webapp/src/pages/SourcesPage/pages/SourceItemPage/SourceItemPage.tsx b/airbyte-webapp/src/pages/SourcesPage/pages/SourceItemPage/SourceItemPage.tsx index 721b7f911847..a3ab70055a6e 100644 --- a/airbyte-webapp/src/pages/SourcesPage/pages/SourceItemPage/SourceItemPage.tsx +++ b/airbyte-webapp/src/pages/SourcesPage/pages/SourceItemPage/SourceItemPage.tsx @@ -1,6 +1,5 @@ import React, { Suspense, useMemo, useState } from "react"; import { FormattedMessage } from "react-intl"; -import styled from "styled-components"; import { useResource } from "rest-hooks"; import config from "config"; @@ -9,8 +8,6 @@ import { Routes } from "pages/routes"; import { ImageBlock } from "components"; import PageTitle from "components/PageTitle"; import useRouter from "components/hooks/useRouterHook"; -import ContentCard from "components/ContentCard"; -import EmptyResource from "components/EmptyResourceBlock"; import Breadcrumbs from "components/Breadcrumbs"; import { ItemTabs, @@ -31,10 +28,7 @@ import SourceDefinitionResource from "core/resources/SourceDefinition"; import DestinationsDefinitionResource from "core/resources/DestinationDefinition"; import { getIcon } from "utils/imageUtils"; import HeadTitle from "components/HeadTitle"; - -const Content = styled(ContentCard)` - margin: 0 32px 0 27px; -`; +import Placeholder, { ResourceTypes } from "components/Placeholder"; const SourceItemPage: React.FC = () => { const { query, push } = useRouter<{ id: string }>(); @@ -131,14 +125,7 @@ const SourceItemPage: React.FC = () => { {connectionsWithSource.length ? ( ) : ( - - } - description={ - - } - /> - + )} );