Skip to content

The open alternative to Salesforce, designed for AI.

Remove useless skelettonLoader (#11096)

martmull6a412a531fb0
diff --git a/packages/twenty-front/src/modules/object-record/record-show/components/SummaryCard.tsx b/packages/twenty-front/src/modules/object-record/record-show/components/SummaryCard.tsx
index f5aac9de84c..13f10430ef0 100644
--- a/packages/twenty-front/src/modules/object-record/record-show/components/SummaryCard.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-show/components/SummaryCard.tsx
@@ -8,7 +8,6 @@ import { recordStoreFamilySelector } from '@/object-record/record-store/states/s
import { recordStoreIdentifierFamilySelector } from '@/object-record/record-store/states/selectors/recordStoreIdentifierSelector';
import { RecordTitleCell } from '@/object-record/record-title-cell/components/RecordTitleCell';
import { ShowPageSummaryCard } from '@/ui/layout/show-page/components/ShowPageSummaryCard';
-import { ShowPageSummaryCardSkeletonLoader } from '@/ui/layout/show-page/components/ShowPageSummaryCardSkeletonLoader';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared';
@@ -55,10 +54,6 @@ export const SummaryCard = ({
}),
);
- if (!isDefined(recordCreatedAt)) {
- return <ShowPageSummaryCardSkeletonLoader />;
- }
-
return (
<ShowPageSummaryCard
isMobile={isMobile}
@@ -68,7 +63,9 @@ export const SummaryCard = ({
iconColor={IconColor}
avatarPlaceholder={recordIdentifier?.name ?? ''}
date={recordCreatedAt ?? ''}
- loading={isPrefetchLoading || recordLoading}
+ loading={
+ isPrefetchLoading || recordLoading || !isDefined(recordCreatedAt)
+ }
title={
<FieldContext.Provider
value={{
diff --git a/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageSummaryCardSkeletonLoader.tsx b/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageSummaryCardSkeletonLoader.tsx
deleted file mode 100644
index 51b15f506c6..00000000000
--- a/packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageSummaryCardSkeletonLoader.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { SKELETON_LOADER_HEIGHT_SIZES } from '@/activities/components/SkeletonLoader';
-import { useTheme } from '@emotion/react';
-import styled from '@emotion/styled';
-import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
-
-const StyledContainer = styled.div`
- display: flex;
- gap: ${({ theme }) => theme.spacing(4)};
- height: ${({ theme }) => theme.spacing(19)};
- margin: ${({ theme }) => theme.spacing(4)};
-`;
-
-const StyledRectangularSkeleton = styled(Skeleton)`
- height: ${({ theme }) => theme.spacing(4)};
- width: ${({ theme }) => theme.spacing(24)};
- margin: ${({ theme }) => theme.spacing(1)};
- border-radius: ${({ theme }) => theme.border.radius.sm};
-`;
-
-export const ShowPageSummaryCardSkeletonLoader = () => {
- const theme = useTheme();
- return (
- <SkeletonTheme
- baseColor={theme.background.tertiary}
- highlightColor={theme.background.transparent.lighter}
- >
- <StyledContainer>
- <Skeleton
- height={SKELETON_LOADER_HEIGHT_SIZES.standard.xl}
- width={40}
- />
- <StyledRectangularSkeleton />
- </StyledContainer>
- </SkeletonTheme>
- );
-};