Skip to content

Commit 4b53746

Browse files
back to default with just pageContainer
1 parent edd8151 commit 4b53746

File tree

10 files changed

+40
-343
lines changed

10 files changed

+40
-343
lines changed

packages/twenty-front/src/modules/error-handler/components/AppErrorBoundary.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,8 @@ import { ErrorInfo, ReactNode } from 'react';
33
import { ErrorBoundary } from 'react-error-boundary';
44

55
import { GenericErrorFallback } from '@/error-handler/components/GenericErrorFallback';
6-
import { RecordIndexErrorFallback } from '@/error-handler/components/RecordIndexErrorFallback';
7-
import { RecordShowErrorFallback } from '@/error-handler/components/RecordShowErrorFallback';
8-
import { SettingsErrorFallback } from '@/error-handler/components/SettingsErrorFallback';
9-
import { ErrorFallbackType } from '@/error-handler/utils/errorFallbackType';
106

11-
type AppErrorBoundaryProps = {
12-
children: ReactNode;
13-
errorFallbackType?: ErrorFallbackType;
14-
};
15-
16-
const getFallbackComponent = (type: ErrorFallbackType) => {
17-
switch (type) {
18-
case ErrorFallbackType.Settings:
19-
return SettingsErrorFallback;
20-
case ErrorFallbackType.RecordShow:
21-
return RecordShowErrorFallback;
22-
case ErrorFallbackType.RecordIndex:
23-
return RecordIndexErrorFallback;
24-
default:
25-
return GenericErrorFallback;
26-
}
27-
};
28-
29-
export const AppErrorBoundary = ({
30-
children,
31-
errorFallbackType = ErrorFallbackType.Default,
32-
}: AppErrorBoundaryProps) => {
7+
export const AppErrorBoundary = ({ children }: { children: ReactNode }) => {
338
const handleError = (_error: Error, _info: ErrorInfo) => {
349
Sentry.captureException(_error, (scope) => {
3510
scope.setExtras({ _info });
@@ -39,7 +14,7 @@ export const AppErrorBoundary = ({
3914

4015
return (
4116
<ErrorBoundary
42-
FallbackComponent={getFallbackComponent(errorFallbackType)}
17+
FallbackComponent={GenericErrorFallback}
4318
onError={handleError}
4419
>
4520
{children}

packages/twenty-front/src/modules/error-handler/components/ErrorBoundaryWrapper.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { ThemeProvider, useTheme } from '@emotion/react';
2-
import isEmpty from 'lodash.isempty';
1+
import { PageBody } from '@/ui/layout/page/components/PageBody';
2+
import { PageContainer } from '@/ui/layout/page/components/PageContainer';
3+
import { PageHeader } from '@/ui/layout/page/components/PageHeader';
34
import { useEffect, useState } from 'react';
45
import { FallbackProps } from 'react-error-boundary';
56
import { useLocation } from 'react-router-dom';
@@ -11,7 +12,6 @@ import {
1112
AnimatedPlaceholderEmptyTitle,
1213
Button,
1314
IconRefresh,
14-
THEME_LIGHT,
1515
} from 'twenty-ui';
1616
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
1717

@@ -31,27 +31,28 @@ export const GenericErrorFallback = ({
3131
}
3232
}, [previousLocation, location, resetErrorBoundary]);
3333

34-
const theme = useTheme();
35-
3634
return (
37-
<ThemeProvider theme={isEmpty(theme) ? THEME_LIGHT : theme}>
38-
<AnimatedPlaceholderEmptyContainer>
39-
<AnimatedPlaceholder type="errorIndex" />
40-
<AnimatedPlaceholderEmptyTextContainer>
41-
<AnimatedPlaceholderEmptyTitle>
42-
Server’s on a coffee break
43-
</AnimatedPlaceholderEmptyTitle>
44-
<AnimatedPlaceholderEmptySubTitle>
45-
{error.message}
46-
</AnimatedPlaceholderEmptySubTitle>
47-
</AnimatedPlaceholderEmptyTextContainer>
48-
<Button
49-
Icon={IconRefresh}
50-
title="Reload"
51-
variant={'secondary'}
52-
onClick={() => resetErrorBoundary()}
53-
/>
54-
</AnimatedPlaceholderEmptyContainer>
55-
</ThemeProvider>
35+
<PageContainer>
36+
<PageHeader />
37+
<PageBody>
38+
<AnimatedPlaceholderEmptyContainer>
39+
<AnimatedPlaceholder type="errorIndex" />
40+
<AnimatedPlaceholderEmptyTextContainer>
41+
<AnimatedPlaceholderEmptyTitle>
42+
Server’s on a coffee break
43+
</AnimatedPlaceholderEmptyTitle>
44+
<AnimatedPlaceholderEmptySubTitle>
45+
{error.message}
46+
</AnimatedPlaceholderEmptySubTitle>
47+
</AnimatedPlaceholderEmptyTextContainer>
48+
<Button
49+
Icon={IconRefresh}
50+
title="Reload"
51+
variant={'secondary'}
52+
onClick={() => resetErrorBoundary()}
53+
/>
54+
</AnimatedPlaceholderEmptyContainer>
55+
</PageBody>
56+
</PageContainer>
5657
);
5758
};

packages/twenty-front/src/modules/error-handler/components/RecordIndexErrorFallback.tsx

Lines changed: 0 additions & 53 deletions
This file was deleted.

packages/twenty-front/src/modules/error-handler/components/RecordShowErrorFallback.tsx

Lines changed: 0 additions & 53 deletions
This file was deleted.

packages/twenty-front/src/modules/error-handler/components/SettingsErrorFallback.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

packages/twenty-front/src/modules/error-handler/utils/errorFallbackType.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/twenty-front/src/modules/error-handler/utils/generateBreadcrumb.ts

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)