Skip to content

Commit 2c459bb

Browse files
committed
fix: add build status favicons based on system theme
1 parent f270d9d commit 2c459bb

17 files changed

+22
-2
lines changed

site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ export const WorkspaceReadyPage = ({
9898
...templateVersion(workspace.template_active_version_id),
9999
enabled: workspace.outdated,
100100
});
101+
const systemTheme = useState(() => {
102+
const isDark = window.matchMedia("(prefers-color-scheme: dark)");
103+
return isDark ? "dark" : "light";
104+
});
101105

102106
const buildLogs = useWorkspaceBuildLogs(workspace.latest_build.id);
103107
const shouldDisplayBuildLogs =
@@ -124,12 +128,12 @@ export const WorkspaceReadyPage = ({
124128
<link
125129
rel="alternate icon"
126130
type="image/png"
127-
href={`/favicons/${favicon}.png`}
131+
href={`/favicons/${favicon}-${systemTheme}.png`}
128132
/>
129133
<link
130134
rel="icon"
131135
type="image/svg+xml"
132-
href={`/favicons/${favicon}.svg`}
136+
href={`/favicons/${favicon}-${systemTheme}.svg`}
133137
/>
134138
</Helmet>
135139

2.49 KB
Loading
Lines changed: 4 additions & 0 deletions
Loading
2.46 KB
Loading
Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)