({ loaderData }: Route.ComponentProps)
| 38 | } |
| 39 | |
| 40 | export default function App({ loaderData }: Route.ComponentProps) { |
| 41 | const { lang, clientEnv } = loaderData |
| 42 | useChangeLanguage(lang) |
| 43 | const fontFaceRules = fonts |
| 44 | .map( |
| 45 | (font) => ` |
| 46 | @font-face { |
| 47 | font-family: "${font.fontFamily}"; |
| 48 | font-style: ${font.fontStyle}; |
| 49 | font-weight: ${font.fontWeight}; |
| 50 | src: url(${font.src}) format("truetype"); |
| 51 | font-display: swap; |
| 52 | } |
| 53 | ` |
| 54 | ) |
| 55 | .join("\n") |
| 56 | return ( |
| 57 | <> |
| 58 | <Outlet /> |
| 59 | {/* biome-ignore lint/security/noDangerouslySetInnerHtml: We set the window.env variable to the client env */} |
| 60 | <script dangerouslySetInnerHTML={{ __html: `window.env = ${JSON.stringify(clientEnv)}` }} /> |
| 61 | {/* biome-ignore lint/security/noDangerouslySetInnerHtml: fonts loading*/} |
| 62 | <style dangerouslySetInnerHTML={{ __html: fontFaceRules }} /> |
| 63 | </> |
| 64 | ) |
| 65 | } |
| 66 | |
| 67 | export const Layout = ({ children }: { children: React.ReactNode }) => { |
| 68 | const { i18n } = useTranslation() |
nothing calls this directly
no outgoing calls
no test coverage detected