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
This commit is contained in:
Antoine Moreaux
2025-04-15 13:43:13 +02:00
committed by GitHub
parent e1ce98825b
commit f30070c2c9

View File

@ -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 (
<StyledContainer>
<StyledPrimaryLogo src={primaryLogoUrl ?? ''} />
{isUsingDefaultLogo ? (
<UndecoratedLink
to={AppPath.SignInUp}
onClick={redirectToDefaultDomain}
>
<StyledPrimaryLogo src={primaryLogoUrl ?? ''} />
</UndecoratedLink>
) : (
<StyledPrimaryLogo src={primaryLogoUrl ?? ''} />
)}
{secondaryLogoUrl && (
<StyledSecondaryLogoContainer>
<StyledSecondaryLogo src={secondaryLogoUrl} />