resourceCard.tsx 888 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import styled from '@emotion/styled';
  2. import Card from 'sentry/components/card';
  3. import ExternalLink from 'sentry/components/links/externalLink';
  4. import {space} from 'sentry/styles/space';
  5. type Props = {
  6. imgUrl: string;
  7. link: string;
  8. title: string;
  9. };
  10. function ResourceCard({title, link, imgUrl}: Props) {
  11. return (
  12. <Card interactive>
  13. <StyledLink href={link}>
  14. <StyledImg src={imgUrl} alt={title} />
  15. <StyledTitle>{title}</StyledTitle>
  16. </StyledLink>
  17. </Card>
  18. );
  19. }
  20. export default ResourceCard;
  21. const StyledLink = styled(ExternalLink)`
  22. padding: ${space(3)};
  23. flex: 1;
  24. `;
  25. const StyledImg = styled('img')`
  26. display: block;
  27. margin: 0 auto ${space(3)} auto;
  28. height: 160px;
  29. `;
  30. const StyledTitle = styled('div')`
  31. color: ${p => p.theme.textColor};
  32. font-size: ${p => p.theme.fontSizeLarge};
  33. text-align: center;
  34. font-weight: bold;
  35. `;