Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: add support for a lighter yellow favicon shade for sandbox #4205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added clients/apps/web/public/favicon-sandbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion clients/apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { CookieConsent } from '@/components/Privacy/CookieConsent'
import SandboxBanner from '@/components/Sandbox/SandboxBanner'
import { UserContextProvider } from '@/providers/auth'
import { getServerSideAPI } from '@/utils/api/serverside'
import { defaultFrontendHostname } from '@/utils/domain'
import { getAuthenticatedUser, getUserOrganizations } from '@/utils/user'
import { Organization, UserRead } from '@polar-sh/sdk'
import { SpeedInsights } from '@vercel/speed-insights/next'
Expand Down Expand Up @@ -63,6 +64,12 @@ export default async function RootLayout({
}
}

const faviconPath = defaultFrontendHostname.startsWith(
'https://sandbox.polar.sh',
)
? '/favicon-sandbox.png'
: '/favicon.png'

return (
<html lang="en" suppressHydrationWarning>
<head>
Expand All @@ -78,7 +85,7 @@ export default async function RootLayout({
media="(prefers-color-scheme: dark)"
></link>
<link
href="/favicon-dark.png"
href={faviconPath}
rel="icon"
media="(prefers-color-scheme: light)"
></link>
Expand Down