Skip to content

Commit

Permalink
💄 style: fix some custom branding detail (lobehub#4465)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Oct 23, 2024
1 parent 9bcaa85 commit 3fb1f6a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/app/(main)/discover/_layout/Desktop/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Link from 'next/link';
import { memo } from 'react';

import { ProductLogo } from '@/components/Branding';
import { isCustomBranding } from '@/const/version';

import CreateButton from '../../features/CreateButton';
import StoreSearchBar from '../../features/StoreSearchBar';
Expand All @@ -17,7 +18,7 @@ const Header = memo(() => {
<ProductLogo extra={'Discover'} size={36} type={'text'} />
</Link>
}
right={<CreateButton />}
right={!isCustomBranding && <CreateButton />}
style={{
position: 'relative',
zIndex: 10,
Expand Down
4 changes: 3 additions & 1 deletion src/app/(main)/settings/llm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import { Flexbox } from 'react-layout-kit';

import { isCustomBranding } from '@/const/version';

import { useProviderList } from './ProviderList/providers';
import ProviderConfig from './components/ProviderConfig';
import Footer from './features/Footer';
Expand All @@ -14,7 +16,7 @@ const Page = () => {
{list.map(({ id, ...res }) => (
<ProviderConfig id={id as any} key={id} {...res} />
))}
<Footer />
{!isCustomBranding && <Footer />}
</Flexbox>
);
};
Expand Down
17 changes: 10 additions & 7 deletions src/app/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Metadata } from 'next';

import { appEnv } from '@/config/app';
import { BRANDING_NAME } from '@/const/branding';
import { BRANDING_LOGO_URL, BRANDING_NAME, ORG_NAME } from '@/const/branding';
import { OFFICIAL_URL, OG_URL } from '@/const/url';
import { isCustomBranding, isCustomORG } from '@/const/version';
import { translation } from '@/server/translation';

const BASE_PATH = appEnv.NEXT_PUBLIC_BASE_PATH;
Expand All @@ -22,11 +23,13 @@ export const generateMetadata = async (): Promise<Metadata> => {
title: BRANDING_NAME,
},
description: t('chat.description', { appName: BRANDING_NAME }),
icons: {
apple: '/apple-touch-icon.png?v=1',
icon: '/favicon.ico?v=1',
shortcut: '/favicon-32x32.ico?v=1',
},
icons: isCustomBranding
? BRANDING_LOGO_URL
: {
apple: '/apple-touch-icon.png?v=1',
icon: '/favicon.ico?v=1',
shortcut: '/favicon-32x32.ico?v=1',
},
manifest: noManifest ? undefined : '/manifest.json',
metadataBase: new URL(OFFICIAL_URL),
openGraph: {
Expand All @@ -53,7 +56,7 @@ export const generateMetadata = async (): Promise<Metadata> => {
card: 'summary_large_image',
description: t('chat.description', { appName: BRANDING_NAME }),
images: [OG_URL],
site: '@lobehub',
site: isCustomORG ? `@${ORG_NAME}` : '@lobehub',
title: t('chat.title', { appName: BRANDING_NAME }),
},
};
Expand Down
6 changes: 6 additions & 0 deletions src/const/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ export const BRANDING_NAME = 'LobeChat';
export const BRANDING_LOGO_URL = '';

export const ORG_NAME = 'LobeHub';

export const BRANDING_URL = {
help: undefined,
privacy: undefined,
terms: undefined,
};
8 changes: 5 additions & 3 deletions src/layout/AuthProvider/Clerk/useAppearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { dark } from '@clerk/themes';
import { ElementsConfig, Theme } from '@clerk/types';
import { createStyles, useThemeMode } from 'antd-style';

import { BRANDING_URL } from '@/const/branding';

const prefixCls = 'cl';

export const useStyles = createStyles(
Expand Down Expand Up @@ -101,10 +103,10 @@ export const useAppearance = () => {
baseTheme: isDarkMode ? dark : undefined,
elements: styles,
layout: {
helpPageUrl: 'https://lobehub.com/docs',
privacyPageUrl: 'https://lobehub.com/privacy',
helpPageUrl: BRANDING_URL.help ?? 'https://lobehub.com/docs',
privacyPageUrl: BRANDING_URL.privacy ?? 'https://lobehub.com/privacy',
socialButtonsVariant: 'blockButton',
termsPageUrl: 'https://lobehub.com/terms',
termsPageUrl: BRANDING_URL.terms ?? 'https://lobehub.com/terms',
},
variables: {
borderRadius: `${theme.borderRadius}px`,
Expand Down

0 comments on commit 3fb1f6a

Please sign in to comment.