Skip to content

Commit 0ccf2c2

Browse files
committed
fix flags on Windows
1 parent e9b31d7 commit 0ccf2c2

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use client';
2+
import { polyfillCountryFlagEmojis } from 'country-flag-emoji-polyfill';
3+
import { useEffect } from 'react';
4+
5+
export function FlagEmojiPolyfill() {
6+
useEffect(() => {
7+
polyfillCountryFlagEmojis();
8+
}, []);
9+
10+
return null;
11+
}

app/layout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { ThemeProvider } from '@/components/theme-provider/theme-provider';
88
import { Toaster } from '@/components/ui/sonner';
99
import { PostHogClientOnlyProvider } from '@/lib/posthog/post-hog-client-only';
1010

11+
import { FlagEmojiPolyfill } from './components/flag-emoji-polyfill';
12+
1113
import './globals.css';
1214

1315
const inter = Inter({ subsets: ['latin'] });
@@ -21,11 +23,15 @@ export const metadata: Metadata = {
2123
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
2224
return (
2325
<html lang="en" suppressHydrationWarning>
24-
<body className={`${inter.className} antialiased`}>
26+
<body
27+
className="antialiased"
28+
style={{ ...inter.style, fontFamily: `'Twemoji Country Flags', ${inter.style.fontFamily}` }}
29+
>
2530
<SessionProvider>
2631
<PostHogClientOnlyProvider>
2732
<NuqsAdapter>
2833
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
34+
<FlagEmojiPolyfill />
2935
<div className="flex flex-col min-h-screen">
3036
<div className="flex-grow">{children}</div>
3137
<Footer />

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@radix-ui/react-tooltip": "^1.2.7",
3232
"class-variance-authority": "^0.7.1",
3333
"clsx": "^2.1.1",
34+
"country-flag-emoji-polyfill": "^0.1.8",
3435
"date-fns": "^4.1.0",
3536
"jsonwebtoken": "^9.0.2",
3637
"lucide-react": "^0.525.0",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)