Skip to content

Commit 1122f73

Browse files
authored
fix: force dark mode in intro (#251)
1 parent 060087b commit 1122f73

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

frontend/src/screens/Intro.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ export function Intro() {
2727
const navigate = useNavigate();
2828
const [api, setApi] = React.useState<CarouselApi>();
2929
const [progress, setProgress] = React.useState<number>(0);
30-
const { theme } = useTheme();
30+
const { setDarkMode } = useTheme();
31+
32+
React.useEffect(() => {
33+
// Force dark mode on intro screen
34+
setDarkMode("dark");
35+
return () => {
36+
// Revert to default after exiting intro
37+
setDarkMode("system");
38+
};
39+
}, [setDarkMode]);
3140

3241
React.useEffect(() => {
3342
if (!info?.setupCompleted) {
@@ -49,7 +58,6 @@ export function Intro() {
4958
style={{
5059
backgroundImage: `url(${Cloud})`,
5160
backgroundPositionX: `${-Math.max(progress, 0) * 40}%`,
52-
filter: theme === "light" ? "invert(0.3)" : undefined,
5361
}}
5462
/>
5563
<div
@@ -58,7 +66,6 @@ export function Intro() {
5866
backgroundImage: `url(${Cloud2})`,
5967
backgroundPositionX: `${150 - Math.max(progress, 0) * 60}%`,
6068
backgroundPositionY: "100%",
61-
filter: theme === "light" ? "invert(0.3)" : undefined,
6269
}}
6370
/>
6471
<CarouselContent className="select-none bg-transparent">

0 commit comments

Comments
 (0)