# Introduction closes https://github.com/twentyhq/core-team-issues/issues/591 Same than for `twenty-shared` made in https://github.com/twentyhq/twenty/pull/11083. ## TODO - [x] Manual migrate twenty-website twenty-ui imports ## What's next: - Generate barrel and migration script factorization within own package + tests - Refactoring using preconstruct ? TimeBox - Lint circular dependencies - Lint import from barrel and forbid them ### Preconstruct We need custom rollup plugins addition, but preconstruct does not expose its rollup configuration. It might be possible to handle this using the babel overrides. But was a big tunnel. We could give it a try afterwards ! ( allowing cjs interop and stuff like that ) Stuck to vite lib app Closed related PRs: - https://github.com/twentyhq/twenty/pull/11294 - https://github.com/twentyhq/twenty/pull/11203
76 lines
2.1 KiB
TypeScript
76 lines
2.1 KiB
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import PreviewBackgroundImage from '../assets/preview-background.svg';
|
|
import SyncImage from '../assets/sync.svg?react';
|
|
import { Card, CardContent } from 'twenty-ui/layout';
|
|
|
|
type SettingsIntegrationPreviewProps = {
|
|
integrationLogoUrl: string;
|
|
};
|
|
|
|
const StyledCard = styled(Card)`
|
|
border: 0;
|
|
`;
|
|
|
|
const StyledCardContent = styled(CardContent)`
|
|
background-image: url(${PreviewBackgroundImage});
|
|
align-items: center;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
height: ${({ theme }) => theme.spacing(28)};
|
|
`;
|
|
|
|
const StyledLogosContainer = styled.div`
|
|
align-items: center;
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
`;
|
|
|
|
const StyledIntegrationLogoContainer = styled.div`
|
|
align-items: center;
|
|
display: flex;
|
|
height: ${({ theme }) => theme.spacing(16)};
|
|
justify-content: center;
|
|
width: ${({ theme }) => theme.spacing(16)};
|
|
`;
|
|
|
|
const StyledIntegrationLogo = styled.img`
|
|
height: 100%;
|
|
`;
|
|
|
|
const StyledTwentyLogo = styled.img`
|
|
height: ${({ theme }) => theme.spacing(12)};
|
|
padding: ${({ theme }) => theme.spacing(2)};
|
|
`;
|
|
|
|
const StyledSyncImage = styled(SyncImage)`
|
|
width: ${({ theme }) => theme.spacing(31)};
|
|
`;
|
|
|
|
const StyledLabel = styled.div`
|
|
color: ${({ theme }) => theme.font.color.tertiary};
|
|
font-size: ${({ theme }) => theme.font.size.sm};
|
|
font-weight: ${({ theme }) => theme.font.weight.medium};
|
|
line-height: ${({ theme }) => theme.spacing(6)};
|
|
`;
|
|
|
|
export const SettingsIntegrationPreview = ({
|
|
integrationLogoUrl,
|
|
}: SettingsIntegrationPreviewProps) => (
|
|
<StyledCard>
|
|
<StyledCardContent>
|
|
<StyledLogosContainer>
|
|
<StyledIntegrationLogoContainer>
|
|
<StyledIntegrationLogo alt="" src={integrationLogoUrl} />
|
|
</StyledIntegrationLogoContainer>
|
|
<StyledSyncImage />
|
|
<StyledTwentyLogo alt="" src="/images/integrations/twenty-logo.svg" />
|
|
</StyledLogosContainer>
|
|
<StyledLabel>Import your tables as remote objects</StyledLabel>
|
|
</StyledCardContent>
|
|
</StyledCard>
|
|
);
|