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

#3513: Align icons in Blueprints sidebar #4455

Merged
merged 1 commit into from
Oct 15, 2022
Merged

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Oct 14, 2022

What does this PR do?

Before / After

Screen Shot 36 Screen Shot 35

Checklist

@codecov
Copy link

codecov bot commented Oct 14, 2022

Codecov Report

Merging #4455 (d81a951) into main (e60ad1a) will increase coverage by 0.00%.
The diff coverage is 25.00%.

@@           Coverage Diff           @@
##             main    #4455   +/-   ##
=======================================
  Coverage   50.00%   50.00%           
=======================================
  Files         907      907           
  Lines       26740    26742    +2     
  Branches     5440     5440           
=======================================
+ Hits        13371    13373    +2     
  Misses      12442    12442           
  Partials      927      927           
Impacted Files Coverage Δ
src/options/pages/blueprints/ListFilters.tsx 67.12% <25.00%> (+0.92%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -6,4 +6,8 @@
font-size: 0.8rem;
color: #bba8bff5;
}

:global .nav-link {
padding-inline: 0.7rem; // Reduce horizontal padding
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reduces the padding inside the selected elements, which at 1rem seems excessive, compared to the available space

<Nav.Link className="media" {...otherProps}>
<FontAwesomeIcon className="align-self-center" icon={icon} />
<span className="media-body ml-2">{label}</span>
</Nav.Link>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should use this pattern in more places:

https://getbootstrap.com/docs/4.0/layout/media-object/

Potentially ListItem could be extracted and reused elsewhere.

Note: Nav.Item was unnecessary and was dropped.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good point! Never thought to apply this pattern to vertical menus before.

Comment on lines +73 to +76
const ListItem: BsPrefixRefForwardingComponent<
"a",
NavLinkProps & { label: string; icon: IconProp }
> = ({ label, icon, ...otherProps }) => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I couldn't find a better way to type this.

  • NavLink isn't generic and can't be extended
  • React.FC<NavLinkProps> for some reason lacks link attributes like href
  • React.FC<NavLink> lacks eventKey, which is part of NavLinkProps
  • React.FC<NavLink & NavLinkProps> is the same as above

@@ -157,7 +171,7 @@ const ListFilters: React.FunctionComponent<ListFiltersProps> = ({

return (
<Col sm={12} md={3} xl={2} className={styles.root}>
<Form className="mr-3">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This margin was unnecessarily reducing the available horizontal space. Bootstrap’s columns already add a lot of space. Was it added to solve any specific issues?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure. It was probably me at some point. Could be an artifact of a spacing issue that got resolved. But I don't see any reason to keep it anymore.

@fregante fregante marked this pull request as ready for review October 14, 2022 10:36
Copy link
Collaborator

@mnholtz mnholtz left a comment

Choose a reason for hiding this comment

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

I love this!!

@fregante fregante merged commit 713e7c3 into main Oct 15, 2022
@fregante fregante deleted the F/ux/align-blueprints-icons branch October 15, 2022 04:00
@twschiller twschiller added this to the 1.7.11 milestone Oct 18, 2022
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.

3 participants