Browse Source
docs: fix PrevAndNext icons RTL (#42822)
* fix: footer prev-and-next rtl fix
* Update .dumi/theme/common/PrevAndNext.tsx
* Update .dumi/theme/common/PrevAndNext.tsx
---------
Co-authored-by: lijianan <574980606@qq.com>
pull/42824/head
未觉雨声
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
6 deletions
-
.dumi/theme/common/PrevAndNext.tsx
-
.dumi/theme/slots/Content/index.tsx
|
|
@ -94,13 +94,16 @@ const flattenMenu = (menuItems: MenuProps['items']): MenuProps['items'] | null = |
|
|
|
return null; |
|
|
|
}; |
|
|
|
|
|
|
|
const PrevAndNext: React.FC = () => { |
|
|
|
const PrevAndNext: React.FC<{ rtl?: boolean }> = ({ rtl }) => { |
|
|
|
const { styles } = useStyle(); |
|
|
|
|
|
|
|
const [menuItems, selectedKey] = useMenu({ |
|
|
|
before: <LeftOutlined className="footer-nav-icon-before" />, |
|
|
|
after: <RightOutlined className="footer-nav-icon-after" />, |
|
|
|
}); |
|
|
|
const beforeProps = { className: 'footer-nav-icon-before' }; |
|
|
|
const afterProps = { className: 'footer-nav-icon-after' }; |
|
|
|
|
|
|
|
const before = rtl ? <LeftOutlined {...beforeProps} /> : <RightOutlined {...beforeProps} />; |
|
|
|
const after = rtl ? <RightOutlined {...afterProps} /> : <LeftOutlined {...afterProps} />; |
|
|
|
|
|
|
|
const [menuItems, selectedKey] = useMenu({ before, after }); |
|
|
|
|
|
|
|
const [prev, next] = useMemo(() => { |
|
|
|
const flatMenu = flattenMenu(menuItems); |
|
|
|
|
|
@ -303,7 +303,7 @@ const Content: React.FC<{ children: ReactNode }> = ({ children }) => { |
|
|
|
/> |
|
|
|
)} |
|
|
|
</article> |
|
|
|
<PrevAndNext /> |
|
|
|
<PrevAndNext rtl={isRTL} /> |
|
|
|
<Footer /> |
|
|
|
</Col> |
|
|
|
</DemoContext.Provider> |
|
|
|