releaseActivityRow.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import styled from '@emotion/styled';
  2. import space from 'sentry/styles/space';
  3. import type {Color} from 'sentry/utils/theme';
  4. interface ReleaseActivityRowProps {
  5. children: React.ReactNode;
  6. icon: React.ReactNode;
  7. iconColor: Color;
  8. hideConnector?: boolean;
  9. }
  10. export function ReleaseActivityRow(props: ReleaseActivityRowProps) {
  11. return (
  12. <Step>
  13. {props.hideConnector ? null : <StepConnector />}
  14. <StepContainer>
  15. <IconContainer color={props.iconColor}>{props.icon}</IconContainer>
  16. <StepContent>{props.children}</StepContent>
  17. </StepContainer>
  18. </Step>
  19. );
  20. }
  21. const Step = styled('div')`
  22. position: relative;
  23. display: flex;
  24. align-items: center;
  25. `;
  26. const StepContainer = styled('div')`
  27. position: relative;
  28. display: flex;
  29. align-items: flex-start;
  30. flex-grow: 1;
  31. `;
  32. const StepContent = styled('div')`
  33. flex-grow: 1;
  34. margin-left: ${space(3)};
  35. `;
  36. const StepConnector = styled('div')`
  37. position: absolute;
  38. height: 100%;
  39. top: 28px;
  40. left: 23px;
  41. border-right: 1px ${p => p.theme.gray300} dashed;
  42. `;
  43. const IconContainer = styled('div')<{color: Color}>`
  44. display: flex;
  45. align-items: center;
  46. padding: ${space(0.5)} ${space(1.5)};
  47. width: 48px;
  48. height: 48px;
  49. border-radius: 50%;
  50. background-color: ${p => p.theme[p.color]};
  51. `;