-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
feat: add 'use star favorite icon' preference #2067
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-docs canceled.
|
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Nice! Two details, we could use red for bookmark so it isnt yellow like the star. So swap the colors if the new option is enabled. And we should add a new env variable to let people hosting the app which should be the default. At least there is one server that would like star by default. We could do this in another PR thought |
That's a good idea! 🙂 I'll update the PR soon. As for the environment variable, maybe I can work on that. But I'm not familiar with those settings yet, so I'll leave that to another PR. |
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.
If getPreferences(userSettings, 'useStarFavoriteIcon')
is used multiple times in a component, should it be extracted into a computed to safe performance?
I don't think it will affect performance, but I agree it is better to extract it 👍🏼 |
Thanks, I tried the |
@@ -149,8 +150,8 @@ function showFavoritedAndBoostedBy() { | |||
|
|||
<CommonDropdownItem | |||
:text="status.favourited ? $t('action.favourited') : $t('action.favourite')" | |||
:icon="status.favourited ? 'i-ri:heart-3-fill' : 'i-ri:heart-3-line'" | |||
:class="status.favourited ? 'text-rose' : ''" | |||
:icon="`${useStarFavoriteIcon ? 'i-ri:star-' : 'i-ri:heart-3-'}${status.favourited ? 'fill' : 'line'}`" |
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.
You should try to always have the classes as fully written out and not dynamically calculated and concatinated because this results in issues
try something like
useStarFavoriteIcon
? status.favourited ? 'i-ri:star-fill' : 'i-ri:star-line'
: status.favourited ? 'i-ri:heart-3-fill' : 'i-ri:heart-3-line'
this also applies to lines below
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.
OK, this was fixed by a new commit. 👍🏻
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.
Another one should also approve 🙂
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.
Awesome 🌟
resolves #2058
This will add an additional option to change the favorite icon.
This will change the color of the icon from rose to yellow but this causes the same color usage as the bookmark icon.