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

Feature/pin to top #954

Closed

Conversation

johannchopin
Copy link
Collaborator

Description

Closes #870.

@carloscuesta @vhoyer Here is my implementation of pinning a gitmoji to the top of the page. It only store the list of codes in the localStorage and sort them accordingly.

Tests

  • All tests passed.

@vercel
Copy link

vercel bot commented Jan 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carloscuesta/gitmoji/4JMN4yzNrV3qDcYdYw9YyLAyDPh6
✅ Preview: https://gitmoji-git-fork-johannchopin-feature-pin-to-top-carloscuesta.vercel.app

@vhoyer
Copy link
Collaborator

vhoyer commented Jan 7, 2022

image

pink pins have bad visibility on grid view, we should probably paint them white in this case.


image

on list view the pins overlap with some large texts


I also don't quite like this pin svg, don't we have a simpler maybe smaller one? also the drop-shadow around it makes it a little too "information heavy" for my tastes.

@johannchopin
Copy link
Collaborator Author

@vhoyer I agree that this icon is kind of 'meeh' at the moment but didn't found at a better UI yet. Wasn't also sure what's the best between a star or a pin.

@carloscuesta
Copy link
Owner

Hey! Thanks for the effort I will review this by the end of the day 😊

Comment on lines +24 to +28
className={`
${styles.emoji} col-xs-12 col-sm-6
${props.isListMode ? 'col-md-4' : 'col-md-3'}
${props.isListMode ? styles.list : ''}
`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have we thought about using classnames cuz this is getting kinda ridiculous haha

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree let's use classnames to simplify this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should @johannchopin install it and make use of it here (and then we create another PR to refactor the rest of the app), or should we do a separate PR including the classnames and refactoring the hole project?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vhoyer would be preferable to do so in another PR when this one is done 👍

src/components/GitmojiList/Gitmoji/index.js Outdated Show resolved Hide resolved
src/components/GitmojiList/Gitmoji/styles.module.css Outdated Show resolved Hide resolved
src/components/GitmojiList/index.js Outdated Show resolved Hide resolved
src/components/GitmojiList/index.js Outdated Show resolved Hide resolved
src/components/GitmojiList/index.js Outdated Show resolved Hide resolved
src/components/GitmojiList/index.js Outdated Show resolved Hide resolved
src/components/GitmojiList/index.js Outdated Show resolved Hide resolved
src/components/GitmojiList/index.js Outdated Show resolved Hide resolved
@vhoyer
Copy link
Collaborator

vhoyer commented Jan 7, 2022

@vhoyer I agree that this icon is kind of 'meeh' at the moment but didn't found at a better UI yet. Wasn't also sure what's the best between a star or a pin.

where did you find this svg icon, @johannchopin?

on a side note: @carloscuesta don't you have an icon pack that you like to use?

@johannchopin
Copy link
Collaborator Author

@vhoyer The icons are comming from the bootstrap free collection --> https://icons.getbootstrap.com/

@carloscuesta
Copy link
Owner

on a side note: @carloscuesta don't you have an icon pack that you like to use?

Not really 🤣

The icon placement seems a bit confusing to me, in grid mode is on the header but in list appears on the card:

Screen Shot 2022-01-07 at 18 21 52

Screen Shot 2022-01-07 at 18 21 56

I would suggest to keep the icon in the same place no matter what the view mode is

@carloscuesta
Copy link
Owner

For the button I would suggest doing a container on top of the icon as this will help us avoiding a11y issues with the contrast of the multiple colors that we have

Something like this:

Screen Shot 2022-01-07 at 18 25 50

@johannchopin
Copy link
Collaborator Author

I would suggest to keep the icon in the same place no matter what the view mode is

@carloscuesta It's common to see actions at the top left of an element like:

image

rather than this layout that is really confusing for me (the 2 buttons are to close):

image

Also moving the button in the header will reduce the emojis space.

@carloscuesta
Copy link
Owner

The only problem I see with the left positioning approach is that the name can be hidden sometimes when the pin is active

@vhoyer
Copy link
Collaborator

vhoyer commented Jan 10, 2022

The only problem I see with the left positioning approach is that the name can be hidden sometimes when the pin is active

@johannchopin @carloscuesta how about we make a proper column for the pin button, like:

'emoji title       pinColumn' auto
'emoji description description' auto /
 auto  1fr         auto;

this way we can have the button at the more intuitive corner, and we also don't overlap the text.

If the empty space is a concern, we could just float the pinButton to the right, that way the pinButton wouldn't overlap with the text, and the text would wrap around the button.

@carloscuesta
Copy link
Owner

Hey @vhoyer I don't understand what you mean with the "code representation" perhaps you can mock it with an image?

@vhoyer
Copy link
Collaborator

vhoyer commented Jan 17, 2022

oh, the notation is basically css' grid-template syntax, not saying we should or shouldn't use display:grid here, just saying I borrowed the syntax to try convey an idea, I will try asap to come up with an image to show it, or maybe I can even open a PR to this PR again

@johannchopin
Copy link
Collaborator Author

@carloscuesta @vhoyer another approach would be to move the button to the bottom right:

image

@carloscuesta
Copy link
Owner

Hey! This PR has been stall for a while so I'll close it! Feel free to reopen it 🙏🏼

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Idea: Pin Emojis to Top
3 participants