apps/web: fix pass USE_DEV_COLORS to client
This commit is contained in:
parent
ae7faa2cbf
commit
780794c53f
@ -1,9 +1,9 @@
|
||||
import { getEnv } from '@/config/env';
|
||||
import { getClientEnv } from '@/config/env';
|
||||
import Image from 'next/image';
|
||||
import logo from 'public/assets/images/logo-primary.svg';
|
||||
import logoDev from 'public/assets/images/logo-primary-dev.svg';
|
||||
|
||||
const env = getEnv();
|
||||
const env = getClientEnv();
|
||||
|
||||
export function Logo() {
|
||||
return (
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
const envSchema = require('./schema/env.js');
|
||||
const { clientEnvSchema, serverEnvSchema } = require('./schema/env');
|
||||
|
||||
const getEnv = () => envSchema.parse(process.env);
|
||||
const getClientEnv = () => clientEnvSchema.parse(process.env);
|
||||
const getServerEnv = () => serverEnvSchema.parse(process.env);
|
||||
|
||||
module.exports = { getEnv };
|
||||
module.exports = { getClientEnv, getServerEnv };
|
||||
|
||||
@ -5,4 +5,12 @@ const envSchema = z.object({
|
||||
NEXT_PUBLIC_USE_DEV_COLORS: z.string().optional(),
|
||||
});
|
||||
|
||||
module.exports = envSchema;
|
||||
const serverEnvSchema = envSchema.pick({
|
||||
URL_IUS_DIRECT: true,
|
||||
});
|
||||
|
||||
const clientEnvSchema = envSchema.pick({
|
||||
NEXT_PUBLIC_USE_DEV_COLORS: true,
|
||||
});
|
||||
|
||||
module.exports = { envSchema, serverEnvSchema, clientEnvSchema };
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { getEnv } from './env';
|
||||
import { getServerEnv } from './env';
|
||||
import proxyUrls from '@/constants/urls';
|
||||
import { isServer } from '@/utils/common';
|
||||
|
||||
export function getUrls() {
|
||||
if (isServer()) {
|
||||
const env = getEnv();
|
||||
const env = getServerEnv();
|
||||
const { URL_IUS_DIRECT } = env;
|
||||
|
||||
return {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { getEnv } from '../config/env';
|
||||
import { getClientEnv } from '../config/env';
|
||||
|
||||
export const COLORS_PROD = {
|
||||
COLOR_DANGER: '#B20004',
|
||||
@ -12,5 +12,5 @@ export const COLORS_DEV = {
|
||||
COLOR_SECONDARY: '#c54a84',
|
||||
COLOR_TERTIARTY: '#FF9112',
|
||||
};
|
||||
const env = getEnv();
|
||||
const env = getClientEnv();
|
||||
export const COLORS = env.NEXT_PUBLIC_USE_DEV_COLORS ? COLORS_DEV : COLORS_PROD;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const envSchema = require('./config/schema/env');
|
||||
const { envSchema } = require('./config/schema/env');
|
||||
const urls = require('./constants/urls');
|
||||
|
||||
const env = envSchema.parse(process.env);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user