feedbackListPage.tsx 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import {RouteComponentProps} from 'react-router';
  2. import styled from '@emotion/styled';
  3. import FeedbackEmptyDetails from 'sentry/components/feedback/details/feedbackEmptyDetails';
  4. import {FeedbackDataContext} from 'sentry/components/feedback/feedbackDataContext';
  5. import FeedbackFilters from 'sentry/components/feedback/feedbackFilters';
  6. import FeedbackItemLoader from 'sentry/components/feedback/feedbackItem/feedbackItemLoader';
  7. import FeedbackSearch from 'sentry/components/feedback/feedbackSearch';
  8. import FeedbackList from 'sentry/components/feedback/list/feedbackList';
  9. import useFeedbackListQueryView from 'sentry/components/feedback/useFeedbackListQueryView';
  10. import FullViewport from 'sentry/components/layouts/fullViewport';
  11. import * as Layout from 'sentry/components/layouts/thirds';
  12. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  13. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  14. import {t} from 'sentry/locale';
  15. import {space} from 'sentry/styles/space';
  16. import {FeedbackItemLoaderQueryParams} from 'sentry/utils/feedback/item/types';
  17. import {decodeScalar} from 'sentry/utils/queryString';
  18. import {useLocation} from 'sentry/utils/useLocation';
  19. import useOrganization from 'sentry/utils/useOrganization';
  20. import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
  21. interface Props extends RouteComponentProps<{}, {}, {}> {}
  22. export default function FeedbackListPage({}: Props) {
  23. const organization = useOrganization();
  24. const location = useLocation<FeedbackItemLoaderQueryParams>();
  25. const queryView = useFeedbackListQueryView({
  26. queryReferrer: 'feedback_list_page',
  27. });
  28. const feedbackSlug = decodeScalar(location.query.feedbackSlug);
  29. return (
  30. <FeedbackDataContext queryView={queryView} initialDate={new Date()}>
  31. <SentryDocumentTitle title={t(`Bug Reports`)} orgSlug={organization.slug}>
  32. <FullViewport>
  33. <Layout.Header>
  34. <Layout.HeaderContent>
  35. <Layout.Title>{t('Bug Reports')}</Layout.Title>
  36. </Layout.HeaderContent>
  37. </Layout.Header>
  38. <PageFiltersContainer>
  39. <LayoutGrid>
  40. <FeedbackFilters style={{gridArea: 'filters'}} />
  41. <FeedbackSearch style={{gridArea: 'search'}} />
  42. <Container style={{gridArea: 'list'}}>
  43. <FeedbackList />
  44. </Container>
  45. <Container style={{gridArea: 'details'}}>
  46. {feedbackSlug ? (
  47. <FeedbackItemLoader feedbackSlug={feedbackSlug} />
  48. ) : (
  49. <FeedbackEmptyDetails />
  50. )}
  51. </Container>
  52. </LayoutGrid>
  53. </PageFiltersContainer>
  54. </FullViewport>
  55. </SentryDocumentTitle>
  56. </FeedbackDataContext>
  57. );
  58. }
  59. const LayoutGrid = styled('div')`
  60. background: ${p => p.theme.background};
  61. height: 100%;
  62. width: 100%;
  63. padding: ${space(2)} ${space(4)};
  64. overflow: hidden;
  65. display: grid;
  66. grid-template-columns: minmax(390px, 1fr) 2fr;
  67. grid-template-rows: max-content 1fr;
  68. grid-template-areas:
  69. 'filters search'
  70. 'list details';
  71. gap: ${space(2)};
  72. place-items: stretch;
  73. `;
  74. const Container = styled(FluidHeight)`
  75. border: 1px solid ${p => p.theme.border};
  76. border-radius: ${p => p.theme.borderRadius};
  77. `;