mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
docs: fix change-log button position (#49552)
* docs: fix changelog button position * fix lint
This commit is contained in:
parent
7e74c79bdd
commit
c5114b3f87
@ -28,16 +28,6 @@ function matchDeprecated(v: string): MatchDeprecatedResult {
|
||||
}
|
||||
|
||||
const useStyle = createStyles(({ token, css }) => ({
|
||||
history: css`
|
||||
position: absolute;
|
||||
top: 0;
|
||||
inset-inline-end: ${token.marginXS}px;
|
||||
`,
|
||||
|
||||
li: css`
|
||||
// white-space: pre;
|
||||
`,
|
||||
|
||||
ref: css`
|
||||
margin-inline-start: ${token.marginXS}px;
|
||||
`,
|
||||
@ -75,7 +65,7 @@ export interface ComponentChangelogProps {
|
||||
|
||||
const locales = {
|
||||
cn: {
|
||||
full: '完整更新日志',
|
||||
full: '查看完整日志',
|
||||
changelog: '更新日志',
|
||||
loading: '加载中...',
|
||||
empty: '暂无更新',
|
||||
@ -213,7 +203,7 @@ const ComponentChangelog: React.FC<ComponentChangelogProps> = (props) => {
|
||||
</Typography.Title>
|
||||
<ul>
|
||||
{changelogList.map<React.ReactNode>((info, index) => (
|
||||
<li key={index} className={styles.li}>
|
||||
<li key={index}>
|
||||
<ParseChangelog {...info} styles={styles} />
|
||||
</li>
|
||||
))}
|
||||
@ -234,7 +224,6 @@ const ComponentChangelog: React.FC<ComponentChangelogProps> = (props) => {
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
className={styles.history}
|
||||
icon={<HistoryOutlined />}
|
||||
onClick={() => {
|
||||
setShow(true);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
|
||||
import { Col, Flex, Typography } from 'antd';
|
||||
import { Space, Col, Flex, Typography } from 'antd';
|
||||
import { createStyles } from 'antd-style';
|
||||
import classNames from 'classnames';
|
||||
import { FormattedMessage, useRouteMeta } from 'dumi';
|
||||
@ -70,25 +70,27 @@ const Content: React.FC<React.PropsWithChildren> = ({ children }) => {
|
||||
</InViewSuspense>
|
||||
<article className={classNames(styles.articleWrapper, { rtl: isRTL })}>
|
||||
{meta.frontmatter?.title ? (
|
||||
<Typography.Title style={{ fontSize: 30, position: 'relative' }}>
|
||||
<Flex gap="small">
|
||||
<div>{meta.frontmatter?.title}</div>
|
||||
<div>{meta.frontmatter?.subtitle}</div>
|
||||
{!pathname.startsWith('/components/overview') && (
|
||||
<InViewSuspense fallback={null}>
|
||||
<EditButton
|
||||
title={<FormattedMessage id="app.content.edit-page" />}
|
||||
filename={meta.frontmatter.filename}
|
||||
/>
|
||||
</InViewSuspense>
|
||||
)}
|
||||
</Flex>
|
||||
<Flex justify="space-between">
|
||||
<Typography.Title style={{ fontSize: 32, position: 'relative' }}>
|
||||
<Space>
|
||||
<span>{meta.frontmatter?.title}</span>
|
||||
<span>{meta.frontmatter?.subtitle}</span>
|
||||
{!pathname.startsWith('/components/overview') && (
|
||||
<InViewSuspense fallback={null}>
|
||||
<EditButton
|
||||
title={<FormattedMessage id="app.content.edit-page" />}
|
||||
filename={meta.frontmatter.filename}
|
||||
/>
|
||||
</InViewSuspense>
|
||||
)}
|
||||
</Space>
|
||||
</Typography.Title>
|
||||
{pathname.startsWith('/components/') && (
|
||||
<InViewSuspense fallback={null}>
|
||||
<ComponentChangelog pathname={pathname} />
|
||||
</InViewSuspense>
|
||||
)}
|
||||
</Typography.Title>
|
||||
</Flex>
|
||||
) : null}
|
||||
<InViewSuspense fallback={null}>
|
||||
<DocMeta />
|
||||
|
Loading…
Reference in New Issue
Block a user