Skip to content

Commit e17dc23

Browse files
me-andreccanosvalentinyanakiev
authored
Loading spinner appears in the right place when Callout is loading (#5437)
Co-authored-by: Carlos Cano <[email protected]> Co-authored-by: Valentin Yanakiev <[email protected]>
1 parent 4041064 commit e17dc23

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/domain/collaboration/CalloutPage/CalloutPage.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { isApolloNotFoundError } from '../../../core/apollo/hooks/useApolloError
1616
import { NotFoundPageLayout } from '../../journey/common/EntityPageLayout';
1717
import { Error404 } from '../../../core/pages/Errors/Error404';
1818
import useBackToPath from '../../../core/routing/useBackToPath';
19+
import usePageLayoutByEntity from '../../shared/utils/usePageLayoutByEntity';
20+
import { EntityPageSection } from '../../shared/layout/EntityPageSection';
1921

2022
interface CalloutLocation {
2123
journeyTypeName: JourneyTypeName;
@@ -104,8 +106,14 @@ const CalloutPage = ({ journeyTypeName, parentRoute, renderPage, children }: Cal
104106

105107
const isSmallScreen = useMediaQuery<Theme>(theme => theme.breakpoints.down('sm'));
106108

109+
const PageLayout = usePageLayoutByEntity(journeyTypeName);
110+
107111
if (isCalloutLoading) {
108-
return <Loading />;
112+
return (
113+
<PageLayout currentSection={EntityPageSection.Contribute}>
114+
<Loading />
115+
</PageLayout>
116+
);
109117
}
110118

111119
if (isApolloNotFoundError(error)) {

0 commit comments

Comments
 (0)