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

User card layout #862

Merged
merged 6 commits into from
Jul 10, 2018
Merged

User card layout #862

merged 6 commits into from
Jul 10, 2018

Conversation

lyyder
Copy link
Contributor

@lyyder lyyder commented Jul 6, 2018

In a certain viewport with a long user name or translations, Edit profile link used to overlap with the heading in UserCard (actually the link was rendered outside the UserCard component):

desktop_before

No the edit profile link has been moved inside the UserCard component and it does not overlap the heading:

desktop_after

Also previously in mobile view the edit profile link used to raise above the whole user card:

mobile_before

Now it's placed in place of the Contact link if the user of the card is logged in:

mobile_after

@lyyder lyyder requested a review from Gnito July 6, 2018 12:15
const hideContact = currentUser && isCurrentUser;
const separator = hideContact ? null : <span className={css.linkSeparator}>•</span>;
const contact = hideContact ? null : (
const separator = isCurrentUser ? null : <span className={css.linkSeparator}>•</span>;
Copy link
Contributor

Choose a reason for hiding this comment

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

The intended behaviour is:

  • unauthenticated user: • contact
  • authenticated user, but not author: • contact
  • authenticated user, author: • edit

If I understood this right, the separator should be printed always (no need for ifs anymore)

Also, {contact} and {editProfileMobile} are alternatives for each others. So, for the clarity:
=> {isCurrentUser ? editProfileMobile : contact}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Almost, but as seen in the second screenshot from the top, in the desktop view the edit profile link is on the right and the separator is hidden.

justify-content: space-between;
align-items: baseline;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you check that the row is always divisible by 6px (and 8px on the desktop layout)? If not, add some padding to top and bottom so that it's size will match that requirement and texts are baselined nicely.

We should be more pedantic with our baseline rules so that there's less need for random margins between elements (i.e. margin-top: 12px makes sense, but 13px is wrong -> some other component has wrong height).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Gnito The component is now internally in baseline. However, I'll see if the css definitions could be improved a bit more to have more logical values regarding the baseline definitions.

@lyyder lyyder force-pushed the user-card-layout branch from 898fd78 to 200adf4 Compare July 10, 2018 06:10
@lyyder lyyder merged commit fe1d722 into master Jul 10, 2018
@lyyder lyyder deleted the user-card-layout branch July 10, 2018 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants