Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions static/app/components/loadingTriangle.stories.tsx

This file was deleted.

59 changes: 0 additions & 59 deletions static/app/components/loadingTriangle.tsx

This file was deleted.

30 changes: 20 additions & 10 deletions static/app/views/organizationContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
import styled from '@emotion/styled';
import {useProfiler} from '@sentry/react';

import {Container} from '@sentry/scraps/layout';

import {Alert} from 'sentry/components/core/alert';
import LoadingError from 'sentry/components/loadingError';
import LoadingTriangle from 'sentry/components/loadingTriangle';
import {ORGANIZATION_FETCH_ERROR_TYPES} from 'sentry/constants';
import {ORGANIZATION_FETCH_ERROR_TYPES, ROOT_ELEMENT} from 'sentry/constants';
import {t} from 'sentry/locale';
import OrganizationStore from 'sentry/stores/organizationStore';
import {useLegacyStore} from 'sentry/stores/useLegacyStore';
import {space} from 'sentry/styles/space';

function OrganizationLoadingIndicator() {
/* Track how long this component is rendered for. */
useProfiler('OrganizationLoadingIndicator', {
hasRenderSpan: true,
});
return <LoadingTriangle>{t('Loading data for your organization.')}</LoadingTriangle>;

/**
* This is the initial loader React will render as the app bootstraps.
* Rather than rendering a loader component, we can reuse the existing DOM
* provided by the server-rendered Django view!
*
* This ensures there are no layout shifts as the app initially boots up
* because the DOM is exactly the same and React doesn't have to reconcile
* the fallback state.
*/
const root = document.getElementById(ROOT_ELEMENT);
// There is no scenario in which this component is rendering,
// but the root element where the app is mounted doesn't exist
const ssrLoader = root!.innerHTML;

return <div dangerouslySetInnerHTML={{__html: ssrLoader}} />;
}

interface Props {
Expand Down Expand Up @@ -70,14 +84,10 @@ function OrganizationContainer({children}: Props) {
<LoadingError />
);

return <ErrorWrapper>{errorBody}</ErrorWrapper>;
return <Container padding="2xl">{errorBody}</Container>;
}

return children;
}

const ErrorWrapper = styled('div')`
padding: ${space(3)};
`;

export default OrganizationContainer;
Loading