Skip to content

Commit 81cc1cc

Browse files
committed
feat: 添加GlobalLogo
1 parent 3c09412 commit 81cc1cc

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/layouts/modules/GlobalLogo.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import clsx from 'clsx';
2+
import { Link } from 'react-router-dom';
3+
import type { LinkProps } from 'react-router-dom';
4+
5+
import SystemLogo from '@/components/SystemLogo';
6+
7+
interface Props extends Omit<LinkProps, 'to'> {
8+
/** Whether to show the title */
9+
showTitle?: boolean;
10+
}
11+
const GlobalLogo: FC<Props> = memo(({ className, showTitle = true, ...props }) => {
12+
const { t } = useTranslation();
13+
14+
return (
15+
<Link
16+
className={clsx('w-full flex-center nowrap-hidden', className)}
17+
to="/"
18+
{...props}
19+
>
20+
<SystemLogo className="text-32px text-primary" />
21+
<h2
22+
className="pl-8px text-16px text-primary font-bold transition duration-300 ease-in-out"
23+
style={{ display: showTitle ? 'block' : 'none' }}
24+
>
25+
{t('system.title')}
26+
</h2>
27+
</Link>
28+
);
29+
});
30+
31+
export default GlobalLogo;

0 commit comments

Comments
 (0)