From 2be77fb55ee85e18648afa455fbcee6b4d568f9d Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Thu, 7 Sep 2023 11:20:12 +0200 Subject: [PATCH] feat: integration sections (#4631) Co-authored-by: sjaanus --- .../AvailableIntegrations.tsx | 134 +++++++++++++++--- .../IntegrationList.styles.tsx | 16 ++- .../JiraIntegration/JiraIntegration.tsx | 11 +- 3 files changed, 126 insertions(+), 35 deletions(-) diff --git a/frontend/src/component/integrations/IntegrationList/AvailableIntegrations/AvailableIntegrations.tsx b/frontend/src/component/integrations/IntegrationList/AvailableIntegrations/AvailableIntegrations.tsx index 2343d020b688..5d9c98062986 100644 --- a/frontend/src/component/integrations/IntegrationList/AvailableIntegrations/AvailableIntegrations.tsx +++ b/frontend/src/component/integrations/IntegrationList/AvailableIntegrations/AvailableIntegrations.tsx @@ -4,14 +4,40 @@ import useLoading from 'hooks/useLoading'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; import { IntegrationCard } from '../IntegrationCard/IntegrationCard'; -import { StyledCardsGrid } from '../IntegrationList.styles'; import { JIRA_INFO } from '../../JiraIntegration/JiraIntegration'; +import { StyledCardsGrid } from '../IntegrationList.styles'; +import { Paper, Typography, styled } from '@mui/material'; interface IAvailableIntegrationsProps { providers: AddonTypeSchema[]; loading?: boolean; } +const StyledContainer = styled('div')(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(12), +})); + +const StyledSection = styled('section')(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(2), +})); + +/** + * @deprecated + * // TODO: refactor + */ +const StyledGrayContainer = styled('div')(({ theme }) => ({ + backgroundColor: theme.palette.background.elevation1, + borderRadius: theme.shape.borderRadiusLarge, + padding: theme.spacing(3), + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1), +})); + export const AvailableIntegrations: VFC = ({ providers, loading, @@ -19,32 +45,94 @@ export const AvailableIntegrations: VFC = ({ const customProviders = [JIRA_INFO]; const ref = useLoading(loading || false); + return ( } + header={} isLoading={loading} + ref={ref} > - - {providers?.map(({ name, displayName, description }) => ( - - ))} - {customProviders?.map(({ name, displayName, description }) => ( - - ))} - + + +
+ + Title + + + Description + +
+ + {providers?.map( + ({ name, displayName, description }) => ( + + ) + )} + {customProviders?.map( + ({ name, displayName, description }) => ( + + ) + )} + +
+ +
+ + Performance and security + + + Description + +
+ + {/* TODO: edge and proxy */} + {/* {providers?.map( + ({ name, displayName, description }) => ( + + ) + )} */} + +
+ + +
+ + Other + + + + Here's some of the fantastic work + {' '} + our community has build to make Unleash work in + even more contexts. + +
+
+
+
); }; diff --git a/frontend/src/component/integrations/IntegrationList/IntegrationList.styles.tsx b/frontend/src/component/integrations/IntegrationList/IntegrationList.styles.tsx index c97ab76c26a5..bd47a49f8fac 100644 --- a/frontend/src/component/integrations/IntegrationList/IntegrationList.styles.tsx +++ b/frontend/src/component/integrations/IntegrationList/IntegrationList.styles.tsx @@ -1,8 +1,12 @@ import { styled } from '@mui/material'; -export const StyledCardsGrid = styled('div')(({ theme }) => ({ - gridTemplateColumns: 'repeat(auto-fit, minmax(350px, 1fr))', - gridAutoRows: '1fr', - gap: theme.spacing(2), - display: 'grid', -})); +export const StyledCardsGrid = styled('div')<{ small?: boolean }>( + ({ theme, small = false }) => ({ + gridTemplateColumns: `repeat(auto-fit, minmax(${ + small ? '250px' : '350px' + }, 1fr))`, + gridAutoRows: '1fr', + gap: theme.spacing(2), + display: 'grid', + }) +); diff --git a/frontend/src/component/integrations/JiraIntegration/JiraIntegration.tsx b/frontend/src/component/integrations/JiraIntegration/JiraIntegration.tsx index 84c9c5d7d390..df13fe678a21 100644 --- a/frontend/src/component/integrations/JiraIntegration/JiraIntegration.tsx +++ b/frontend/src/component/integrations/JiraIntegration/JiraIntegration.tsx @@ -5,17 +5,16 @@ import { IntegrationIcon } from '../IntegrationList/IntegrationIcon/IntegrationI import cr from 'assets/img/jira/cr.png'; import connect from 'assets/img/jira/connect.png'; import manage from 'assets/img/jira/manage.png'; -import React from 'react'; import { JiraImageContainer } from './JiraImageContainer'; -export const StyledContainer = styled('div')(({ theme }) => ({ +const StyledContainer = styled('div')(({ theme }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(2), })); -export const StyledGrayContainer = styled('div')(({ theme }) => ({ - backgroundColor: theme.palette.grey[100], +const StyledGrayContainer = styled('div')(({ theme }) => ({ + backgroundColor: theme.palette.background.elevation1, borderRadius: theme.shape.borderRadiusLarge, padding: theme.spacing(3), display: 'flex', @@ -23,13 +22,13 @@ export const StyledGrayContainer = styled('div')(({ theme }) => ({ gap: theme.spacing(1), })); -export const StyledIconLine = styled('div')(({ theme }) => ({ +const StyledIconLine = styled('div')(({ theme }) => ({ display: 'flex', marginLeft: theme.spacing(1), alignItems: 'center', })); -export const StyledLink = styled('a')({ +const StyledLink = styled('a')({ textDecoration: 'none', });