apps/web: fix pass USE_DEV_COLORS variable to client
This commit is contained in:
parent
e033886097
commit
126643982b
2
.env
2
.env
@ -1,3 +1,3 @@
|
|||||||
USE_DEV_COLORS=
|
NEXT_PUBLIC_USE_DEV_COLORS=
|
||||||
|
|
||||||
URL_IUS_DIRECT=
|
URL_IUS_DIRECT=
|
||||||
@ -6,5 +6,7 @@ import logoDev from 'public/assets/images/logo-primary-dev.svg';
|
|||||||
const env = getEnv();
|
const env = getEnv();
|
||||||
|
|
||||||
export function Logo() {
|
export function Logo() {
|
||||||
return <Image priority alt="logo" src={env.USE_DEV_COLORS ? logoDev : logo} height="24" />;
|
return (
|
||||||
|
<Image priority alt="logo" src={env.NEXT_PUBLIC_USE_DEV_COLORS ? logoDev : logo} height="24" />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ const { z } = require('zod');
|
|||||||
|
|
||||||
const envSchema = z.object({
|
const envSchema = z.object({
|
||||||
URL_IUS_DIRECT: z.string(),
|
URL_IUS_DIRECT: z.string(),
|
||||||
USE_DEV_COLORS: z.string().optional(),
|
NEXT_PUBLIC_USE_DEV_COLORS: z.string().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = envSchema;
|
module.exports = envSchema;
|
||||||
|
|||||||
@ -13,4 +13,4 @@ export const COLORS_DEV = {
|
|||||||
COLOR_TERTIARTY: '#FF9112',
|
COLOR_TERTIARTY: '#FF9112',
|
||||||
};
|
};
|
||||||
const env = getEnv();
|
const env = getEnv();
|
||||||
export const COLORS = env.USE_DEV_COLORS ? COLORS_DEV : COLORS_PROD;
|
export const COLORS = env.NEXT_PUBLIC_USE_DEV_COLORS ? COLORS_DEV : COLORS_PROD;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ const urls = require('./constants/urls');
|
|||||||
const env = envSchema.parse(process.env);
|
const env = envSchema.parse(process.env);
|
||||||
|
|
||||||
const favicons = fs.readdirSync('./public/favicon/prod');
|
const favicons = fs.readdirSync('./public/favicon/prod');
|
||||||
const faviconSubPath = env.USE_DEV_COLORS ? '/favicon/dev' : '/favicon/prod';
|
const faviconSubPath = env.NEXT_PUBLIC_USE_DEV_COLORS ? '/favicon/dev' : '/favicon/prod';
|
||||||
function buildFaviconRewrite(source) {
|
function buildFaviconRewrite(source) {
|
||||||
return {
|
return {
|
||||||
destination: String.prototype.concat(faviconSubPath, source),
|
destination: String.prototype.concat(faviconSubPath, source),
|
||||||
@ -34,7 +34,6 @@ const nextConfig = {
|
|||||||
...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`)),
|
...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`)),
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
env,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = nextConfig;
|
module.exports = nextConfig;
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
external_client:
|
external_client:
|
||||||
environment:
|
# environment:
|
||||||
- URL_IUS_DIRECT=${URL_IUS_DIRECT}
|
# - URL_IUS_DIRECT=${URL_IUS_DIRECT}
|
||||||
- USE_DEV_COLORS=${USE_DEV_COLORS}
|
# - NEXT_PUBLIC_USE_DEV_COLORS=${NEXT_PUBLIC_USE_DEV_COLORS}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./apps/web/Dockerfile
|
dockerfile: ./apps/web/Dockerfile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user