Skip to content

Commit

Permalink
staging
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardZaydler committed Sep 11, 2024
1 parent 892dc05 commit 4026f40
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM nginx:alpine
COPY --from=build-env /app/dist /usr/share/nginx/html
COPY src/favicon.ico /usr/share/nginx/html
COPY src/favicon-dev.ico /usr/share/nginx/html
COPY src/favicon-staging.ico /usr/share/nginx/html

RUN rm /etc/nginx/conf.d/default.conf
COPY pkg/nginx/locations /etc/nginx/conf.d/locations
Expand Down
14 changes: 12 additions & 2 deletions src/Components/Favicon/Favicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,26 @@ import React, { useEffect, useState } from "react";
import FaviconComponent from "react-favicon";
import { useSelector } from "react-redux";
import { selectPlatform } from "../../store/Reducers/ConfigReducer.slice";
import { Platform } from "../../Domain/Config";

const Favicon = () => {
const platform = useSelector(selectPlatform);

const [faviconUrl, setFaviconUrl] = useState<string>("../favicon.ico");

useEffect(() => {
const url = "../favicon-dev.ico";
if (!platform) {
return;
}

setFaviconUrl(url);
switch (platform) {
case Platform.DEV:
setFaviconUrl("../favicon-dev.ico");
break;
case Platform.STAGING:
setFaviconUrl("../favicon-staging.ico");
break;
}
}, [platform]);

return <FaviconComponent url={faviconUrl} />;
Expand Down
Binary file added src/favicon-staging.ico
Binary file not shown.
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ module.exports = {
),
new HtmlWebpackPlugin({
template: "./src/index.html",
// favicon: "./src/favicon.ico",
inject: "body",
minify: {
collapseWhitespace: true,
Expand Down

0 comments on commit 4026f40

Please sign in to comment.