From 64c45a52257e031e987ee38a40ae874335efbf6f Mon Sep 17 00:00:00 2001 From: pranalidhanavade Date: Tue, 12 Mar 2024 16:14:32 +0530 Subject: [PATCH] refactor: handled condition for name with logo image Signed-off-by: pranalidhanavade --- src/commonComponents/LogoFile.tsx | 10 ++++++---- src/config/envConfig.ts | 4 +++- src/pages/index.astro | 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/commonComponents/LogoFile.tsx b/src/commonComponents/LogoFile.tsx index 5860577b4..d191480ce 100644 --- a/src/commonComponents/LogoFile.tsx +++ b/src/commonComponents/LogoFile.tsx @@ -1,4 +1,4 @@ - +import React from 'react'; import { envConfig } from '../config/envConfig'; const LogoFile = () => { @@ -9,9 +9,11 @@ const LogoFile = () => { className="h-8 mr-3" alt={`${envConfig.PLATFORM_DATA.name} logo`} /> - {envConfig.PLATFORM_DATA.name} + {envConfig.PLATFORM_DATA.nameAsLogo === 'true' && ( + + {envConfig.PLATFORM_DATA.name} + + )} ) diff --git a/src/config/envConfig.ts b/src/config/envConfig.ts index 1f67433be..f0be039b9 100644 --- a/src/config/envConfig.ts +++ b/src/config/envConfig.ts @@ -17,7 +17,7 @@ if (import.meta.env) { } } -const { PUBLIC_BASE_URL, PUBLIC_CRYPTO_PRIVATE_KEY, PUBLIC_PLATFORM_NAME, PUBLIC_PLATFORM_LOGO, PUBLIC_POWERED_BY, PUBLIC_PLATFORM_WEB_URL, PUBLIC_POWERED_BY_URL, PUBLIC_PLATFORM_DOCS_URL, PUBLIC_PLATFORM_GIT, PUBLIC_PLATFORM_SUPPORT_EMAIL, PUBLIC_PLATFORM_TWITTER_URL, PUBLIC_PLATFORM_SUPPORT_INVITE, PUBLIC_PLATFORM_DISCORD_URL }: any = envVariables; +const { PUBLIC_BASE_URL, PUBLIC_CRYPTO_PRIVATE_KEY,PUBLIC_SHOW_NAME_AS_LOGO, PUBLIC_PLATFORM_NAME, PUBLIC_PLATFORM_LOGO, PUBLIC_POWERED_BY, PUBLIC_PLATFORM_WEB_URL, PUBLIC_POWERED_BY_URL, PUBLIC_PLATFORM_DOCS_URL, PUBLIC_PLATFORM_GIT, PUBLIC_PLATFORM_SUPPORT_EMAIL, PUBLIC_PLATFORM_TWITTER_URL, PUBLIC_PLATFORM_SUPPORT_INVITE, PUBLIC_PLATFORM_DISCORD_URL }: any = envVariables; export const envConfig = { PUBLIC_BASE_URL: @@ -26,6 +26,8 @@ export const envConfig = { PUBLIC_CRYPTO_PRIVATE_KEY || import.meta.env.PUBLIC_CRYPTO_PRIVATE_KEY, PLATFORM_DATA: { + nameAsLogo: + PUBLIC_SHOW_NAME_AS_LOGO || import.meta.env.PUBLIC_SHOW_NAME_AS_LOGO, name: PUBLIC_PLATFORM_NAME || import.meta.env.PUBLIC_PLATFORM_NAME, logo: diff --git a/src/pages/index.astro b/src/pages/index.astro index ceca255c7..0397c43cd 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,7 +4,6 @@ import PublicNavbar from '../commonComponents/PublicNavbar.astro'; import { envConfig } from '../config/envConfig'; const cookie = Astro.cookies.get("platform-data").value; const env = import.meta.env || process.env; -console.log(2433, env, cookie); ---