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
parent
commit
0547bc6f85
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      .dumi/theme/common/PrevAndNext.tsx
  2. 2
      .dumi/theme/slots/Content/index.tsx

13
.dumi/theme/common/PrevAndNext.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);

2
.dumi/theme/slots/Content/index.tsx

@ -303,7 +303,7 @@ const Content: React.FC<{ children: ReactNode }> = ({ children }) => {
/>
)}
</article>
<PrevAndNext />
<PrevAndNext rtl={isRTL} />
<Footer />
</Col>
</DemoContext.Provider>

Loading…
Cancel
Save