Skip to content

Commit

Permalink
📝 docs: 优化文档展示细节
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 21, 2023
1 parent d983019 commit 8d2a167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
20 changes: 11 additions & 9 deletions .dumi/theme/builtins/SourceCode/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CheckOutlined, CopyOutlined } from '@ant-design/icons';
import { Button, Tooltip } from 'antd';
import { Button, ConfigProvider, Tooltip } from 'antd';
import { createStyles } from 'antd-style';
import copy from 'copy-to-clipboard';
import { FC } from 'react';
Expand Down Expand Up @@ -61,14 +61,16 @@ const SourceCode: FC<HighlighterProps> = ({ children, language }) => {
)
}
>
<Button
icon={<CopyOutlined />}
className={styles.button}
onClick={() => {
copy(children);
setCopied();
}}
/>
<ConfigProvider theme={{ token: { colorBgContainer: theme.colorBgElevated } }}>
<Button
icon={<CopyOutlined />}
className={styles.button}
onClick={() => {
copy(children);
setCopied();
}}
/>
</ConfigProvider>
</Tooltip>
<Highlighter language={language}>{children}</Highlighter>
</div>
Expand Down
9 changes: 5 additions & 4 deletions .dumi/theme/slots/Logo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import { memo, type FC } from 'react';

import { useSiteStore } from '../../store/useSiteStore';

import { useWhyDidYouUpdate } from 'ahooks';
import { useStyles } from './style';

const Logo: FC = () => {
const locale = useLocale();
const themeConfig = useSiteStore((s) => s.siteData.themeConfig, isEqual);
const { styles } = useStyles();
const { styles, cx, theme } = useStyles();

useWhyDidYouUpdate('Logo', { locale, themeConfig });
return (
themeConfig && (
<Link className={styles} to={'base' in locale ? locale.base : '/'}>
<Link
className={cx(theme.stylish.clickableText, styles)}
to={'base' in locale ? locale.base : '/'}
>
<img src={themeConfig.logo} alt={themeConfig.name} />
{themeConfig.name}
</Link>
Expand Down

0 comments on commit 8d2a167

Please sign in to comment.