Skip to content

Commit

Permalink
🐛 fix: Fix Logo3d
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jun 17, 2024
1 parent 8f256da commit 507324c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
7 changes: 2 additions & 5 deletions src/brand/LobeChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ import { useTheme } from 'antd-style';
import { type ReactNode, memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import { useCdnFn } from '@/ConfigProvider';
import Img from '@/Img';
import { DivProps } from '@/types';

import Divider from './components/Divider';
import LogoText from './components/LobeChatText';
import Logo3d from './components/Logo3d';
import LogoFlat from './components/LogoFlat';
import LogoMono from './components/LogoMono';
import { LOGO_3D, useStyles } from './style';
import { useStyles } from './style';

export interface LobeChatProps extends DivProps {
/**
Expand All @@ -34,7 +32,6 @@ export interface LobeChatProps extends DivProps {

const LobeChat = memo<LobeChatProps>(
({ type = '3d', size = 32, style, extra, className, ...rest }) => {
const genCdnUrl = useCdnFn();
const theme = useTheme();
const { styles } = useStyles();
let logoComponent: ReactNode;
Expand All @@ -61,7 +58,7 @@ const LobeChat = memo<LobeChatProps>(
case 'combine': {
logoComponent = (
<>
<Img alt="LobeChat" height={size} src={genCdnUrl(LOGO_3D)} width={size} />
<Logo3d alt="LobeChat" size={size} />
<LogoText size={size} style={{ marginLeft: Math.round(size / 4) }} />
</>
);
Expand Down
8 changes: 1 addition & 7 deletions src/brand/LobeHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useTheme } from 'antd-style';
import { type ReactNode, memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import Img from '@/Img';
import { DivProps } from '@/types';

import Divider from './components/Divider';
Expand Down Expand Up @@ -59,12 +58,7 @@ const LobeHub = memo<LobeHubProps>(
case 'combine': {
logoComponent = (
<>
<Img
alt="LobeHub"
height={size}
src={'https://hub-apac-1.lobeobjects.space/logo-3d.webp'}
width={size}
/>
<Logo3d alt="LobeChat" size={size} />
<LogoText size={size} style={{ marginLeft: Math.round(size / 4) }} />
</>
);
Expand Down
16 changes: 8 additions & 8 deletions src/brand/components/Logo3d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { ImgProps } from '@/types';

import { LOGO_3D } from '../style';

const Logo3d = memo<ImgProps & ImageProps & { size?: number | string }>(
({ size = '1em', style, alt = 'LobeHub', ...rest }) => {
const genCdnUrl = useCdnFn();
return (
<Img alt={alt} height={size} src={genCdnUrl(LOGO_3D)} style={style} width={size} {...rest} />
);
},
);
const Logo3d = memo<
Omit<ImgProps & ImageProps, 'width' | 'height' | 'src'> & { size?: number | string }
>(({ size = '1em', style, alt = 'LobeHub', ...rest }) => {
const genCdnUrl = useCdnFn();
return (
<Img alt={alt} height={size} src={genCdnUrl(LOGO_3D)} style={style} width={size} {...rest} />
);
});

export default Logo3d;

0 comments on commit 507324c

Please sign in to comment.