mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
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>
This commit is contained in:
parent
ac51334a15
commit
0547bc6f85
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user