groupEventDetailsLoading.tsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import styled from '@emotion/styled';
  2. import {Flex} from 'sentry/components/container/flex';
  3. import LoadingIndicator from 'sentry/components/loadingIndicator';
  4. import Placeholder from 'sentry/components/placeholder';
  5. import {space} from 'sentry/styles/space';
  6. import {useUser} from 'sentry/utils/useUser';
  7. /**
  8. * Do not import more things into this component since it is used in routes.ts
  9. */
  10. export function GroupEventDetailsLoading() {
  11. const user = useUser();
  12. /**
  13. * Not using useHasStreamlinedUI because we want to limit modules imported
  14. * in routes.ts
  15. */
  16. if (!user?.options?.prefersIssueDetailsStreamlinedUI) {
  17. return <LoadingIndicator />;
  18. }
  19. return (
  20. <div>
  21. <LoadingGroupContent>
  22. <LoadingHeader>
  23. <Flex align="center" gap={space(1)}>
  24. <Placeholder width="100px" height="22px" />
  25. <Placeholder width="100px" height="22px" />
  26. </Flex>
  27. <Flex align="center" gap={space(1)}>
  28. <Placeholder width="80px" height="22px" />
  29. <Placeholder width="80px" height="22px" />
  30. <Placeholder width="80px" height="22px" />
  31. <Placeholder width="80px" height="22px" />
  32. <Placeholder width="80px" height="22px" />
  33. </Flex>
  34. </LoadingHeader>
  35. <LoadingHeader>
  36. <Placeholder width="100%" height="22px" />
  37. </LoadingHeader>
  38. <LoadingHeader>
  39. <Placeholder width="100%" height="500px" />
  40. </LoadingHeader>
  41. <LoadingHeader>
  42. <Placeholder width="100%" height="120px" />
  43. </LoadingHeader>
  44. </LoadingGroupContent>
  45. </div>
  46. );
  47. }
  48. const LoadingGroupContent = styled('div')`
  49. min-height: 90vh;
  50. border: 1px solid ${p => p.theme.translucentBorder};
  51. background: ${p => p.theme.background};
  52. border-radius: ${p => p.theme.borderRadius};
  53. `;
  54. const LoadingHeader = styled('div')`
  55. padding: ${space(1.5)} ${space(2)};
  56. display: flex;
  57. justify-content: space-between;
  58. align-items: center;
  59. gap: ${space(2)};
  60. border-bottom: 1px solid ${p => p.theme.translucentBorder};
  61. overflow: hidden;
  62. `;