Files
twenty/packages/twenty-website/src/app/_components/user-guide/UserGuideCard.tsx
T
Ady Beraud dc32f65906 Fixed user guide layout (#5422)
- Added border-radius to image cards in User Guide:
Before: 
<img width="376" alt="Screenshot 2024-05-15 at 11 05 35"
src="https://github.com/twentyhq/twenty/assets/102751374/88e63152-2a50-49d5-89cb-522d94c26d3f">

After: 
<img width="366" alt="Screenshot 2024-05-15 at 11 08 20"
src="https://github.com/twentyhq/twenty/assets/102751374/f21b39d8-74eb-4520-8357-78409d7c8598">

- Centered and aligned index and article pages
2024-05-15 10:24:24 +02:00

69 lines
1.7 KiB
TypeScript

'use client';
import styled from '@emotion/styled';
import { useRouter } from 'next/navigation';
import { Theme } from '@/app/_components/ui/theme/theme';
import { UserGuideArticlesProps } from '@/content/user-guide/constants/getUserGuideArticles';
const StyledContainer = styled.div`
color: ${Theme.border.color.plain};
border: 2px solid ${Theme.border.color.plain};
border-radius: ${Theme.border.radius.md};
gap: ${Theme.spacing(4)};
display: flex;
flex-direction: column;
cursor: pointer;
&:hover {
box-shadow: -8px 8px 0px -4px ${Theme.color.gray60};
}
`;
const StyledHeading = styled.div`
font-size: ${Theme.font.size.lg};
color: ${Theme.text.color.primary};
padding: 0 16px;
font-weight: ${Theme.font.weight.medium};
@media (max-width: 800px) {
font-size: ${Theme.font.size.base};
}
`;
const StyledSubHeading = styled.div`
font-size: ${Theme.font.size.xs};
color: ${Theme.text.color.secondary};
font-family: ${Theme.font.family};
margin: 0 16px 24px;
font-weight: ${Theme.font.weight.regular};
line-height: 21px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
`;
const StyledImage = styled.img`
border-bottom: 1.5px solid #14141429;
height: 160px;
border-top-right-radius: 8px;
border-top-left-radius: 8px;
`;
export default function UserGuideCard({
card,
}: {
card: UserGuideArticlesProps;
}) {
const router = useRouter();
return (
<StyledContainer
onClick={() => router.push(`/user-guide/${card.fileName}`)}
>
<StyledImage src={card.image} alt={card.title} />
<StyledHeading>{card.title}</StyledHeading>
<StyledSubHeading>{card.info}</StyledSubHeading>
</StyledContainer>
);
}