From f30070c2c94a9906eda9cfd4ced61de53fdfd4c9 Mon Sep 17 00:00:00 2001 From: Antoine Moreaux Date: Tue, 15 Apr 2025 13:43:13 +0200 Subject: [PATCH] feat(auth): enhance logo behavior and simplify billing logic (#11574) Added default domain redirection functionality to the Logo component, leveraging UndecoratedLink for navigation when default logos are used. Removed metered product billing feature flag logic in the billing webhook subscription service to simplify and streamline the codebase. Fix https://github.com/twentyhq/core-team-issues/issues/783 --- .../src/modules/auth/components/Logo.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/auth/components/Logo.tsx b/packages/twenty-front/src/modules/auth/components/Logo.tsx index 5b671a96f..2efe26719 100644 --- a/packages/twenty-front/src/modules/auth/components/Logo.tsx +++ b/packages/twenty-front/src/modules/auth/components/Logo.tsx @@ -1,6 +1,9 @@ import styled from '@emotion/styled'; import { isNonEmptyString } from '@sniptt/guards'; import { REACT_APP_SERVER_BASE_URL } from '~/config'; +import { useRedirectToDefaultDomain } from '~/modules/domain-manager/hooks/useRedirectToDefaultDomain'; +import { AppPath } from '~/modules/types/AppPath'; +import { UndecoratedLink } from 'twenty-ui/navigation'; import { getImageAbsoluteURI } from 'twenty-shared/utils'; type LogoProps = { @@ -45,6 +48,7 @@ const StyledPrimaryLogo = styled.div<{ src: string }>` `; export const Logo = (props: LogoProps) => { + const { redirectToDefaultDomain } = useRedirectToDefaultDomain(); const defaultPrimaryLogoUrl = `${window.location.origin}/icons/android/android-launchericon-192-192.png`; const primaryLogoUrl = getImageAbsoluteURI({ @@ -59,9 +63,20 @@ export const Logo = (props: LogoProps) => { }) : null; + const isUsingDefaultLogo = !props.primaryLogo; + return ( - + {isUsingDefaultLogo ? ( + + + + ) : ( + + )} {secondaryLogoUrl && (