To avoid white screens on reload, building a shared skeleton. Before https://github.com/user-attachments/assets/42bd0667-141d-4df4-9072-4077192cc71d After https://github.com/user-attachments/assets/e6031a72-2e25-47e3-a873-b89aaddfbd3a
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { styled } from '@linaria/react';
|
|
|
|
import { useShowAuthModal } from '@/ui/layout/hooks/useShowAuthModal';
|
|
import { RootStackingContextZIndices } from '@/ui/layout/constants/RootStackingContextZIndices';
|
|
import { NAVIGATION_DRAWER_CONSTRAINTS } from '@/ui/layout/resizable-panel/constants/NavigationDrawerConstraints';
|
|
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
|
|
import { ModalBackdrop } from 'twenty-ui/layout';
|
|
import { LeftPanelSkeletonLoader } from '~/loading/components/LeftPanelSkeletonLoader';
|
|
import { RightPanelSkeletonLoader } from '~/loading/components/RightPanelSkeletonLoader';
|
|
|
|
const StyledContainer = styled.div`
|
|
background: ${themeCssVariables.background.noisy};
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
flex-direction: row;
|
|
height: 100dvh;
|
|
min-width: ${NAVIGATION_DRAWER_CONSTRAINTS.default}px;
|
|
overflow: hidden;
|
|
width: 100%;
|
|
|
|
@media (max-width: ${MOBILE_VIEWPORT}px) {
|
|
width: 100%;
|
|
}
|
|
`;
|
|
|
|
const StyledLeftPanelWrapper = styled.div`
|
|
flex-shrink: 0;
|
|
padding: 12px 0 12px 8px;
|
|
`;
|
|
|
|
export const UserOrMetadataLoader = () => {
|
|
const showAuthModal = useShowAuthModal();
|
|
|
|
return (
|
|
<StyledContainer>
|
|
{showAuthModal && (
|
|
<ModalBackdrop
|
|
overlay="dark"
|
|
backdropZIndex={RootStackingContextZIndices.RootModalBackDrop}
|
|
/>
|
|
)}
|
|
<StyledLeftPanelWrapper>
|
|
<LeftPanelSkeletonLoader />
|
|
</StyledLeftPanelWrapper>
|
|
<RightPanelSkeletonLoader />
|
|
</StyledContainer>
|
|
);
|
|
};
|