Skip to content
Snippets Groups Projects

feat(frontend): Allow specifying customizations using env variables

Merged Arnaud Vergnet requested to merge topic/default/var-env-custom into branch/default
2 files
+ 3
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -3,8 +3,7 @@
import { AppRouterCacheProvider } from "@mui/material-nextjs/v14-appRouter";
export const metadata: Metadata = {
title: "Rodolf",
description: "Bonjour",
title: process.env.RODOLF_APP_TITLE ?? "Rodolf",
};
// See https://mui.com/material-ui/guides/nextjs/
@@ -14,5 +13,7 @@
children: React.ReactNode;
}) {
const API_ENDPOINT = process.env.RODOLF_API_URL;
const APP_TITLE = process.env.RODOLF_APP_TITLE;
const APP_LOGO = process.env.RODOLF_APP_LOGO;
if (!API_ENDPOINT) {
@@ -17,9 +18,9 @@
if (!API_ENDPOINT) {
throw new Error("No api endpoint configured");
console.error("No api endpoint configured");
}
return (
<html lang="en">
<body style={{ margin: 0 }}>
<AppRouterCacheProvider>
@@ -20,10 +21,16 @@
}
return (
<html lang="en">
<body style={{ margin: 0 }}>
<AppRouterCacheProvider>
<BaseLayout endpoint={API_ENDPOINT}>{children}</BaseLayout>
<BaseLayout
endpoint={API_ENDPOINT}
title={APP_TITLE ?? "Rodolf"}
logoBase64={APP_LOGO}
>
{children}
</BaseLayout>
</AppRouterCacheProvider>
</body>
</html>
Loading