-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
[UX] Add messages when there are no games to display in the library #3536
Conversation
> | ||
{t('add_game', 'Add Game')} | ||
</button> | ||
<AddGameButton /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracted this into a component to use it in the empty library message
font-size: 2rem; | ||
max-width: 500px; | ||
margin: auto; | ||
padding-bottom: 20%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this message looks odd vertically centered, this padding moves it a bit up
@@ -222,6 +222,10 @@ | |||
}, | |||
"title": "Downloads" | |||
}, | |||
"emptyLibrary": { | |||
"noGames": "Your library is empty. You can <1>log in</1> using a store or click <3></3> to add one manually.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these <1>
and <3>
are intentional, the Trans
component replaces them with the tags from the children
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty good UX improvement that we have been missing for a long time. Should be on the next release and will help a lot of new users.
This PR adds 2 messages when we have no games to show:
I'm using this
Trans
element that supports rendering components and HTML inside it, so thelog in
andadd game
elements are interactive in the message. At the same time it provides safety against translations including unwanted HTML since it can only show the HTML we allow (check the translation strings have<1>
and<3>
, i18next handle that internally, so translators have to use them for elements to render. Then i18next replaces those tags with the ones from the children.Use the following Checklist if you have changed something on the Backend or Frontend: