Custom logout button
Is there a way to change the sider logout button text? I'm using themedSider, and wanted to customize the initial logout button passed on render to be labeled "Bye!" instead of "Logout". How would I do this?
render prop. Here is an example of how you can achieve this:render prop is used to customize the content of the sider. The element is cloned and its children are replaced with the text "Bye!".render prop to modify the existing logout button. Here is an example of how you can achieve this:render prop is used to customize the content of the sider. The element is cloned and its children are replaced with the text "Bye!".<ThemedSiderV2><ThemedSiderV2>logoutlogoutimport { Refine } from "@refinedev/core";
import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";
const App: React.FC = () => {
return (
<Refine
// ...
>
<ThemedLayoutV2
Sider={() => (
<ThemedSiderV2
render={({ items, logout, collapsed }) => {
return (
<>
<div>My Custom Element</div>
{items}
{React.cloneElement(logout, {}, "Bye!")}
</>
);
}}
/>
)}
>
{/* ... */}
</ThemedLayoutV2>
</Refine>
);
}; import { Refine } from "@refinedev/core";
import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";
const App: React.FC = () => {
return (
<Refine
// ...
>
<ThemedLayoutV2
Sider={() => (
<ThemedSiderV2
render={({ items, logout, collapsed }) => {
return (
<>
<div>My Custom Element</div>
{items}
{React.cloneElement(logout, {}, "Bye!")}
</>
);
}}
/>
)}
>
{/* ... */}
</ThemedLayoutV2>
</Refine>
);
};