Skip to content

Commit

Permalink
docs: fix import wrap style (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Nov 27, 2024
1 parent 1731062 commit c0bf866
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
9 changes: 5 additions & 4 deletions .dumi/theme/builtins/ComponentMeta/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EditOutlined, GithubOutlined, HistoryOutlined } from '@ant-design/icons';
import type { GetProp } from 'antd';
import { Descriptions, Space, Tooltip, Typography, theme } from 'antd';
import { Descriptions, Flex, Tooltip, Typography, theme } from 'antd';
import { createStyles, css } from 'antd-style';
import kebabCase from 'lodash/kebabCase';
import React from 'react';
Expand Down Expand Up @@ -50,6 +50,7 @@ const useStyle = createStyles(({ token }) => ({
transition: all ${token.motionDurationSlow} !important;
font-family: ${token.codeFamily};
color: ${token.colorTextSecondary} !important;
white-space: nowrap;
&:hover {
background: ${token.controlItemBgHover};
}
Expand Down Expand Up @@ -166,7 +167,7 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
title={copied ? locale.copied : locale.copy}
onOpenChange={onOpenChange}
>
<Typography.Text className={styles.code} onClick={onCopy}>
<Typography.Text className={styles.code} ellipsis onClick={onCopy}>
{importList}
</Typography.Text>
</Tooltip>
Expand All @@ -185,7 +186,7 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
filename && {
label: locale.docs,
children: (
<Space size="middle">
<Flex gap={16}>
<Typography.Link
className={styles.code}
href={`${branchUrl}${filename}`}
Expand All @@ -200,7 +201,7 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
<span>{locale.changelog}</span>
</Typography.Link>
</ComponentChangelog>
</Space>
</Flex>
),
},
isVersionNumber(version) && {
Expand Down
32 changes: 15 additions & 17 deletions .dumi/theme/slots/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Col, Flex, Space, Typography } from 'antd';
import { Col, Flex, Typography } from 'antd';
import classNames from 'classnames';
import { FormattedMessage, useRouteMeta } from 'dumi';
import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
Expand Down Expand Up @@ -54,22 +54,20 @@ const Content: React.FC<React.PropsWithChildren> = ({ children }) => {
</InViewSuspense>
<article className={classNames(styles.articleWrapper, { rtl: isRTL })}>
{meta.frontmatter?.title ? (
<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>
</Flex>
<Typography.Title style={{ fontSize: 32, position: 'relative' }}>
<Flex gap={8} wrap>
<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>
)}
</Flex>
</Typography.Title>
) : null}
<InViewSuspense fallback={null}>
<DocMeta />
Expand Down

0 comments on commit c0bf866

Please sign in to comment.