[RFR] Add ability to customize icon in Logout button #4229
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
For an admin web application I'm building I have applied quite some theming to the default
react-admin
layout and style. A bit of work, but it is supported quite well and also documented surprisingly well.I wanted to use a different icon for the logout button. By default it uses the
<ExitIcon />
(power symbol). I personally prefer using a different icon to represent the logout action in applications:<ExitToAppIcon/>
.With help of the documentation I found that it was only possible to achieve this by using a completely custom login button component. So I copied the source of the original
Logout
component and I changed the icon in my application. All good! But not great.Motivation
The
Logout
component contains quite a bit of logic. All this logic is now in my custom login button component. The logout button of my app won't benefit from future updates of thereact-admin
framework to theLogout
component due to the usage of a custom component.Therefore I thought it would be nice to add the option to only change the icon of the default
Logout
component.Changes described
I modified the component, described this option in the Theming documentation and also added an entry for the
Logout
component to the Reference file. I've used it in the simple example locally (not committed) with the following result:If this PR is accepted and included in a release I can drop the custom login button component and simply configure the icon.