site: update log tag style (#53102)

This commit is contained in:
lijianan
2025-03-09 22:13:21 +08:00
committed by GitHub
parent a77684cbd9
commit 1fd31e90ca

View File

@@ -1,6 +1,6 @@
import React, { useMemo } from 'react';
import type { MenuProps } from 'antd';
import { Space, Tag, version } from 'antd';
import { Flex, Tag, version } from 'antd';
import { createStyles } from 'antd-style';
import classnames from 'classnames';
import { useFullSidebarData, useSidebarData } from 'dumi';
@@ -25,6 +25,7 @@ const getTagColor = (val?: string) => {
if (val?.toUpperCase() === 'DEPRECATED') {
return 'red';
}
return 'success';
};
const useStyle = createStyles(({ css, token }) => ({
@@ -61,13 +62,13 @@ const MenuItemLabelWithTag: React.FC<MenuItemLabelProps> = (props) => {
if (!before && !after) {
return (
<Link to={`${link}${search}`} className={classnames(className, { [styles.link]: tag })}>
<Space>
<Flex justify="flex-start" align="center" gap="small">
<span>{title}</span>
{subtitle && <span className={styles.subtitle}>{subtitle}</span>}
</Space>
</Flex>
{tag && (
<Tag bordered={false} className={classnames(styles.tag)} color={getTagColor(tag)}>
{tag.replace('VERSION', version)}
{tag.replace(/VERSION/i, version)}
</Tag>
)}
</Link>