mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
site: update log tag style (#53102)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user