Lab image cover (#10027)
Added Object-Cover to eliminate image distortion. Set all cards to the large variant to enhance the design. --------- Co-authored-by: ehconitin <nitinkoche03@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f31ee88fe8
commit
ef1b492e2f
@ -4,31 +4,21 @@ import { useLabPublicFeatureFlags } from '@/settings/lab/hooks/useLabPublicFeatu
|
||||
import styled from '@emotion/styled';
|
||||
import { useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { Card, MOBILE_VIEWPORT } from 'twenty-ui';
|
||||
import { Card } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
const StyledCardGrid = styled.div`
|
||||
display: grid;
|
||||
gap: ${({ theme }) => theme.spacing(4)};
|
||||
grid-template-columns: 1fr;
|
||||
|
||||
& > *:not(:first-child) {
|
||||
grid-column: span 1;
|
||||
}
|
||||
|
||||
@media (min-width: ${MOBILE_VIEWPORT}px) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
|
||||
& > *:first-child {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledImage = styled.img<{ isFirstCard: boolean }>`
|
||||
const StyledImage = styled.img`
|
||||
border-bottom: 1px solid ${({ theme }) => theme.border.color.medium};
|
||||
height: ${({ isFirstCard }) => (isFirstCard ? '240px' : '120px')};
|
||||
height: 120px;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
display: flex;
|
||||
`;
|
||||
|
||||
export const SettingsLabContent = () => {
|
||||
@ -59,13 +49,12 @@ export const SettingsLabContent = () => {
|
||||
return 1;
|
||||
return 0;
|
||||
})
|
||||
.map((flag, index) => (
|
||||
.map((flag) => (
|
||||
<Card key={flag.key} rounded>
|
||||
{flag.metadata.imagePath && !hasImageLoadingError[flag.key] ? (
|
||||
<StyledImage
|
||||
src={flag.metadata.imagePath}
|
||||
alt={flag.metadata.label}
|
||||
isFirstCard={index === 0}
|
||||
onError={() => handleImageError(flag.key)}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user