Skip to content

The open alternative to Salesforce, designed for AI.

Added the dark mode version of empty states (#3906)

Jeet Desaib286232ea76c
diff --git a/packages/twenty-front/public/images/placeholders/background/no_match_record_bg.png b/packages/twenty-front/public/images/placeholders/background/no_match_record_bg.png
new file mode 100644
index 00000000000..344bec7a0c7
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/background/no_match_record_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/404_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/404_bg.png
new file mode 100644
index 00000000000..f29437c8646
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/404_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/500_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/500_bg.png
new file mode 100644
index 00000000000..9f353ecc748
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/500_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/empty_inbox_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/empty_inbox_bg.png
new file mode 100644
index 00000000000..5f680bc413e
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/empty_inbox_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/empty_timeline_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/empty_timeline_bg.png
new file mode 100644
index 00000000000..90d2bf5ab8e
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/empty_timeline_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/error_index_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/error_index_bg.png
new file mode 100644
index 00000000000..79d119b363e
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/error_index_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/no_file_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/no_file_bg.png
new file mode 100644
index 00000000000..71e62236cd9
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/no_file_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/no_match_record_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/no_match_record_bg.png
new file mode 100644
index 00000000000..da554e159f2
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/no_match_record_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/no_note_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/no_note_bg.png
new file mode 100644
index 00000000000..31e067553c5
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/no_note_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/no_record_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/no_record_bg.png
new file mode 100644
index 00000000000..e68793922b4
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/no_record_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-background/no_task_bg.png b/packages/twenty-front/public/images/placeholders/dark-background/no_task_bg.png
new file mode 100644
index 00000000000..89f1f183a35
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-background/no_task_bg.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/404.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/404.png
new file mode 100644
index 00000000000..52070a50c6f
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/404.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/500.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/500.png
new file mode 100644
index 00000000000..053d7bf3b85
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/500.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/empty_inbox.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/empty_inbox.png
new file mode 100644
index 00000000000..d6623118223
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/empty_inbox.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/empty_timeline.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/empty_timeline.png
new file mode 100644
index 00000000000..7d28b7a3fc0
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/empty_timeline.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/error_index.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/error_index.png
new file mode 100644
index 00000000000..eff835bed3c
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/error_index.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/no_file.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_file.png
new file mode 100644
index 00000000000..cdcb7f644c3
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_file.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/no_match_record.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_match_record.png
new file mode 100644
index 00000000000..178059bc52b
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_match_record.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/no_note.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_note.png
new file mode 100644
index 00000000000..0917eea67d9
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_note.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/no_record.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_record.png
new file mode 100644
index 00000000000..06324972d4c
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_record.png differ
diff --git a/packages/twenty-front/public/images/placeholders/dark-moving-image/no_task.png b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_task.png
new file mode 100644
index 00000000000..c185fe6f216
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/dark-moving-image/no_task.png differ
diff --git a/packages/twenty-front/public/images/placeholders/moving-image/no_match_record.png b/packages/twenty-front/public/images/placeholders/moving-image/no_match_record.png
new file mode 100644
index 00000000000..f6e84a9d520
Binary files /dev/null and b/packages/twenty-front/public/images/placeholders/moving-image/no_match_record.png differ
diff --git a/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx b/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx
index 6bb58a61c70..b343e44abd3 100644
--- a/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/animated-placeholder/components/AnimatedPlaceholder.tsx
@@ -1,10 +1,13 @@
import { useEffect } from 'react';
+import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { motion, useMotionValue, useTransform } from 'framer-motion';
import { animate } from 'framer-motion';
import {
Background,
+ DarkBackground,
+ DarkMovingImage,
MovingImage,
} from '@/ui/layout/animated-placeholder/constants/AnimatedImages';
@@ -40,6 +43,8 @@ interface AnimatedPlaceholderProps {
}
const AnimatedPlaceholder = ({ type }: AnimatedPlaceholderProps) => {
+ const theme = useTheme();
+
const x = useMotionValue(window.innerWidth / 2);
const y = useMotionValue(window.innerHeight / 2);
@@ -84,12 +89,12 @@ const AnimatedPlaceholder = ({ type }: AnimatedPlaceholderProps) => {
return (
<StyledContainer>
<StyledBackgroundImage
- src={Background[type]}
+ src={theme.name === 'dark' ? DarkBackground[type] : Background[type]}
alt="Background"
type={type}
/>
<StyledMovingImage
- src={MovingImage[type]}
+ src={theme.name === 'dark' ? DarkMovingImage[type] : MovingImage[type]}
alt="Moving"
style={{ translateX, translateY }}
transition={{ type: 'spring', stiffness: 100, damping: 10 }}
diff --git a/packages/twenty-front/src/modules/ui/layout/animated-placeholder/constants/AnimatedImages.ts b/packages/twenty-front/src/modules/ui/layout/animated-placeholder/constants/AnimatedImages.ts
index a24b4670205..4a028be52eb 100644
--- a/packages/twenty-front/src/modules/ui/layout/animated-placeholder/constants/AnimatedImages.ts
+++ b/packages/twenty-front/src/modules/ui/layout/animated-placeholder/constants/AnimatedImages.ts
@@ -2,6 +2,7 @@ export const Background: Record<string, string> = {
noFile: '/images/placeholders/background/no_file_bg.png',
noNote: '/images/placeholders/background/no_note_bg.png',
noRecord: '/images/placeholders/background/no_record_bg.png',
+ noMatchRecord: '/images/placeholders/background/no_match_record_bg.png',
noTask: '/images/placeholders/background/no_task_bg.png',
errorIndex: '/images/placeholders/background/error_index_bg.png',
emptyTimeline: '/images/placeholders/background/empty_timeline_bg.png',
@@ -16,6 +17,7 @@ export const MovingImage: Record<string, string> = {
noFile: '/images/placeholders/moving-image/no_file.png',
noNote: '/images/placeholders/moving-image/no_note.png',
noRecord: '/images/placeholders/moving-image/no_record.png',
+ noMatchRecord: '/images/placeholders/moving-image/no_match_record.png',
noTask: '/images/placeholders/moving-image/no_task.png',
errorIndex: '/images/placeholders/moving-image/error_index.png',
emptyTimeline: '/images/placeholders/moving-image/empty_timeline.png',
@@ -25,3 +27,33 @@ export const MovingImage: Record<string, string> = {
error404: '/images/placeholders/moving-image/404.png',
error500: '/images/placeholders/moving-image/500.png',
};
+
+export const DarkBackground: Record<string, string> = {
+ noFile: '/images/placeholders/dark-background/no_file_bg.png',
+ noNote: '/images/placeholders/dark-background/no_note_bg.png',
+ noRecord: '/images/placeholders/dark-background/no_record_bg.png',
+ noMatchRecord: '/images/placeholders/dark-background/no_match_record_bg.png',
+ noTask: '/images/placeholders/dark-background/no_task_bg.png',
+ errorIndex: '/images/placeholders/dark-background/error_index_bg.png',
+ emptyTimeline: '/images/placeholders/dark-background/empty_timeline_bg.png',
+ emptyInbox: '/images/placeholders/dark-background/empty_inbox_bg.png',
+ error404: '/images/placeholders/dark-background/404_bg.png',
+ error500: '/images/placeholders/dark-background/500_bg.png',
+ loadingMessages: '/images/placeholders/background/loading_messages_bg.png',
+ loadingAccounts: '/images/placeholders/background/loading_accounts_bg.png',
+};
+
+export const DarkMovingImage: Record<string, string> = {
+ noFile: '/images/placeholders/dark-moving-image/no_file.png',
+ noNote: '/images/placeholders/dark-moving-image/no_note.png',
+ noRecord: '/images/placeholders/dark-moving-image/no_record.png',
+ noMatchRecord: '/images/placeholders/dark-moving-image/no_match_record.png',
+ noTask: '/images/placeholders/dark-moving-image/no_task.png',
+ errorIndex: '/images/placeholders/dark-moving-image/error_index.png',
+ emptyTimeline: '/images/placeholders/dark-moving-image/empty_timeline.png',
+ emptyInbox: '/images/placeholders/dark-moving-image/empty_inbox.png',
+ error404: '/images/placeholders/dark-moving-image/404.png',
+ error500: '/images/placeholders/dark-moving-image/500.png',
+ loadingMessages: '/images/placeholders/moving-image/loading_messages.png',
+ loadingAccounts: '/images/placeholders/moving-image/loading_accounts.png',
+};