Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Add ability to customize icon in Logout button #4229

Merged
merged 2 commits into from
Jan 3, 2020

Conversation

steurt
Copy link
Contributor

@steurt steurt commented Dec 31, 2019

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 the react-admin framework to the Logout 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:
Screenshot 2019-12-31 at 15 03 22

If this PR is accepted and included in a release I can drop the custom login button component and simply configure the icon.

@ThieryMichel ThieryMichel added this to the 3.2.0 milestone Jan 3, 2020
@ThieryMichel ThieryMichel changed the title [RFR] Add support to configure a different icon for the Logout component [RFR] Add icon props to Logout component Jan 3, 2020
@ThieryMichel ThieryMichel merged commit ae3c2f7 into marmelab:next Jan 3, 2020
@fzaninotto fzaninotto changed the title [RFR] Add icon props to Logout component [RFR] Add ability to customize icon in Logout button Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants