diff --git a/frontend/webapp/components/overview/index.tsx b/frontend/webapp/components/overview/index.tsx index 799574495..d6c9f8384 100644 --- a/frontend/webapp/components/overview/index.tsx +++ b/frontend/webapp/components/overview/index.tsx @@ -2,3 +2,4 @@ export { OverviewHeader } from "./overview.header/overview.header"; export { ManageDestination } from "./destination/manage.destination/manage.destination"; export { DestinationsManagedList } from "./destination/destination.list/destinations.managed.list"; export { SourcesManagedList } from "./sources/sources.manage.list/sources.manage.list"; +export { SourcesActionMenu } from "./sources/action.menu/sources.action.menu"; diff --git a/frontend/webapp/components/overview/sources/action.menu/sources.action.menu.styled.tsx b/frontend/webapp/components/overview/sources/action.menu/sources.action.menu.styled.tsx new file mode 100644 index 000000000..610dedddb --- /dev/null +++ b/frontend/webapp/components/overview/sources/action.menu/sources.action.menu.styled.tsx @@ -0,0 +1,11 @@ +import styled from "styled-components"; + +export const SourcesMenuWrapper = styled.div` + width: 100%; + margin-top: 32px; + padding-top: 88px; + display: flex; + justify-content: space-between; +`; + +export const InputsWrapper = styled.div``; diff --git a/frontend/webapp/components/overview/sources/action.menu/sources.action.menu.tsx b/frontend/webapp/components/overview/sources/action.menu/sources.action.menu.tsx new file mode 100644 index 000000000..7d13296f9 --- /dev/null +++ b/frontend/webapp/components/overview/sources/action.menu/sources.action.menu.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import { + InputsWrapper, + SourcesMenuWrapper, +} from "./sources.action.menu.styled"; +import { KeyvalButton, KeyvalText } from "@/design.system"; +import { Plus } from "@/assets/icons/overview"; +import { OVERVIEW } from "@/utils/constants"; +import theme from "@/styles/palette"; + +const BUTTON_STYLES = { gap: 10, height: 36 }; + +export function SourcesActionMenu({ onAddClick }) { + return ( + + + + + + {OVERVIEW.ADD_NEW_SOURCE} + + + + ); +} diff --git a/frontend/webapp/components/overview/sources/sources.manage.list/sources.manage.styled.tsx b/frontend/webapp/components/overview/sources/sources.manage.list/sources.manage.styled.tsx index 12350c2a4..ffbdffed2 100644 --- a/frontend/webapp/components/overview/sources/sources.manage.list/sources.manage.styled.tsx +++ b/frontend/webapp/components/overview/sources/sources.manage.list/sources.manage.styled.tsx @@ -27,7 +27,7 @@ export const EmptyListWrapper = styled.div` `; export const ManagedListWrapper = styled.div` - height: 80%; + height: 75%; display: flex; flex-wrap: wrap; gap: 24px; @@ -38,6 +38,5 @@ export const ManagedListWrapper = styled.div` export const ManagedContainer = styled.div` width: 100%; height: 100%; - margin-top: 120px; padding: 0px 36px; `; diff --git a/frontend/webapp/containers/overview/sources/new.source.flow.tsx b/frontend/webapp/containers/overview/sources/new.source.flow.tsx new file mode 100644 index 000000000..c77035124 --- /dev/null +++ b/frontend/webapp/containers/overview/sources/new.source.flow.tsx @@ -0,0 +1,28 @@ +import React from "react"; +import { useSectionData } from "@/hooks"; +import { SourcesSectionWrapper, ButtonWrapper } from "./sources.styled"; +import { SourcesSection } from "@/containers/setup/sources/sources.section"; +import { KeyvalButton, KeyvalText } from "@/design.system"; +import theme from "@/styles/palette"; +import { SETUP } from "@/utils/constants"; + +export function NewSourceFlow() { + const { sectionData, setSectionData, totalSelected } = useSectionData({}); + + return ( + + + {`${totalSelected} ${SETUP.SELECTED}`} + + + Connect + + + + + + ); +} diff --git a/frontend/webapp/containers/overview/sources/sources.styled.tsx b/frontend/webapp/containers/overview/sources/sources.styled.tsx index c361682ec..c3fa07df0 100644 --- a/frontend/webapp/containers/overview/sources/sources.styled.tsx +++ b/frontend/webapp/containers/overview/sources/sources.styled.tsx @@ -5,3 +5,21 @@ export const SourcesContainerWrapper = styled.div` width: 100%; overflow: hidden; `; + +export const MenuWrapper = styled.div` + padding: 0 32px; +`; + +export const SourcesSectionWrapper = styled(MenuWrapper)` + margin-top: 88px; + position: relative; +`; + +export const ButtonWrapper = styled.div` + position: absolute; + display: flex; + align-items: center; + gap: 16px; + right: 32px; + top: 40px; +`; diff --git a/frontend/webapp/containers/overview/sources/sources.tsx b/frontend/webapp/containers/overview/sources/sources.tsx index 784be7026..2d3af77cb 100644 --- a/frontend/webapp/containers/overview/sources/sources.tsx +++ b/frontend/webapp/containers/overview/sources/sources.tsx @@ -1,19 +1,41 @@ "use client"; -import React from "react"; +import React, { useState } from "react"; import { KeyvalLoader } from "@/design.system"; import { OVERVIEW, QUERIES } from "@/utils/constants"; import { useQuery } from "react-query"; import { getSources } from "@/services"; -import { OverviewHeader, SourcesManagedList } from "@/components/overview"; -import { SourcesContainerWrapper } from "./sources.styled"; +import { + OverviewHeader, + SourcesActionMenu, + SourcesManagedList, +} from "@/components/overview"; +import { SourcesContainerWrapper, MenuWrapper } from "./sources.styled"; +import { NewSourceFlow } from "./new.source.flow"; export function SourcesContainer() { + const [displayNewSourceFlow, setDisplayNewSourceFlow] = useState(false); + const { data: sources, refetch, isLoading, } = useQuery([QUERIES.API_SOURCES], getSources); + function renderNewSourceFlow() { + return ; + } + + function renderSources() { + return ( + <> + + setDisplayNewSourceFlow(true)} /> + + + + ); + } + if (isLoading) { return ; } @@ -21,7 +43,7 @@ export function SourcesContainer() { return ( - + {displayNewSourceFlow ? renderNewSourceFlow() : renderSources()} ); } diff --git a/frontend/webapp/utils/constants/string.tsx b/frontend/webapp/utils/constants/string.tsx index b16b6a9eb..8591b7e1a 100644 --- a/frontend/webapp/utils/constants/string.tsx +++ b/frontend/webapp/utils/constants/string.tsx @@ -62,6 +62,7 @@ export const OVERVIEW = { SOURCES: "Sources", DESTINATIONS: "Destinations", }, + ADD_NEW_SOURCE: "Add New Source", ADD_NEW_DESTINATION: "Add New Destination", DESTINATION_UPDATE_SUCCESS: "Destination updated successfully", DESTINATION_CREATED_SUCCESS: "Destination created successfully",