From 20300f46691b051c3bfe890fecfac103ce6b1b0e Mon Sep 17 00:00:00 2001 From: Stefan Forstenlechner Date: Sat, 9 Apr 2022 21:10:50 +0200 Subject: [PATCH] Use .env file --- picture-gallery-client/.env | 3 +++ picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx | 2 +- picture-gallery-client/src/MuiLayout/AppBar.tsx | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 picture-gallery-client/.env diff --git a/picture-gallery-client/.env b/picture-gallery-client/.env new file mode 100644 index 0000000..d02bb3c --- /dev/null +++ b/picture-gallery-client/.env @@ -0,0 +1,3 @@ +# Set user specific variables +REACT_APP_TITLE=Simple Picture Gallery +REACT_APP_APPBAR_COLOR=#1976D2 diff --git a/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx b/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx index 8937f83..7683ebc 100644 --- a/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx +++ b/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx @@ -27,7 +27,7 @@ function ImageGalleryAppBar({ - {process.env.TITLE ?? "Image Gallery"} + {process.env.REACT_APP_TITLE ?? "Simple Picture Gallery"} diff --git a/picture-gallery-client/src/MuiLayout/AppBar.tsx b/picture-gallery-client/src/MuiLayout/AppBar.tsx index 605cec8..32365e1 100644 --- a/picture-gallery-client/src/MuiLayout/AppBar.tsx +++ b/picture-gallery-client/src/MuiLayout/AppBar.tsx @@ -7,6 +7,7 @@ const AppBar = styled(MuiAppBar, { open?: boolean; drawerwidth: number; }>(({ theme, open, drawerwidth }) => ({ + backgroundColor: process.env.REACT_APP_APPBAR_COLOR ?? "#1976D2", transition: theme.transitions.create(["margin", "width"], { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen,