buildStep.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import styled from '@emotion/styled';
  2. import ListItem from 'sentry/components/list/listItem';
  3. import space from 'sentry/styles/space';
  4. interface Props {
  5. children: React.ReactNode;
  6. description: string;
  7. title: string;
  8. required?: boolean;
  9. }
  10. export function BuildStep({title, description, required = false, children}: Props) {
  11. return (
  12. <Wrapper>
  13. <Heading>
  14. {title}
  15. {required && <RequiredBadge />}
  16. </Heading>
  17. <SubHeading>{description}</SubHeading>
  18. <Content>{children}</Content>
  19. </Wrapper>
  20. );
  21. }
  22. const Wrapper = styled(ListItem)`
  23. display: grid;
  24. `;
  25. const Heading = styled('h5')`
  26. margin-bottom: 0;
  27. color: ${p => p.theme.gray500};
  28. `;
  29. const SubHeading = styled('small')`
  30. color: ${p => p.theme.gray300};
  31. padding: ${space(0.25)} ${space(2)} ${space(2)} 0;
  32. @media (max-width: ${p => p.theme.breakpoints.small}) {
  33. padding-top: ${space(1)};
  34. margin-left: -${space(4)};
  35. }
  36. `;
  37. const Content = styled('div')`
  38. display: grid;
  39. @media (max-width: ${p => p.theme.breakpoints.small}) {
  40. margin-left: -${space(4)};
  41. }
  42. `;
  43. const RequiredBadge = styled('div')`
  44. background: ${p => p.theme.red300};
  45. opacity: 0.6;
  46. width: 5px;
  47. height: 5px;
  48. border-radius: 5px;
  49. margin-left: ${space(0.5)};
  50. display: inline-block;
  51. vertical-align: super;
  52. `;