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

fix: Adjust sidebar banner to wrap bellow the title #1819

Merged

Conversation

oliverwhite19
Copy link
Contributor

Description

Fixes #1607

Makes it so that the sidebar and banner don't appear in the same row.

Screenshots

Before

Before

After

Screenshot 2023-07-04 at 21 36 25

@@ -33,7 +33,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {
<div className="site-sidebar accordion">
<section id="sidebarInfo" className="card border-secondary mb-3">
<header
className="card-header d-flex align-items-center"
className="card-header d-flex align-items-center flex-wrap"
id="sidebarInfoHeader"
>
{this.siteName()}
Copy link
Member

Choose a reason for hiding this comment

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

I'd put a bit of margin bottom on the site name when the banner is displaying, but other than that you're good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've conditionally added some margin on the header

@jsit
Copy link
Contributor

jsit commented Jul 5, 2023

I think rather than doing flex-wrap, these should probably just be on different rows to begin with. And I wonder if it would look better with the banner on top?

@oliverwhite19
Copy link
Contributor Author

I think rather than doing flex-wrap, these should probably just be on different rows to begin with. And I wonder if it would look better with the banner on top?

I've set the elements on different rows and it does simplify things. I don't like the idea of putting the banner on top because then you move the collapse button up and down, which is bad UX imo

@@ -54,7 +51,7 @@ export class SiteSidebar extends Component<SiteSidebarProps, SiteSidebarState> {

siteName() {
return (
<>
<div className={!this.state.collapsed ? "mb-2" : undefined}>
Copy link
Member

Choose a reason for hiding this comment

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

If the 2nd condition is empty, just do !this.state.collapsed && "mb-2" , or ever better, use the classNames util.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

!this.state.collapsed && "mb-2" gives a typescript error because it doesn't like passing a boolean to className, but the classNames util works great, thanks for telling me about it!

@dessalines dessalines merged commit 53a5bfe into LemmyNet:main Jul 7, 2023
1 check passed
@oliverwhite19 oliverwhite19 deleted the 1607-sidebar-banner-alignment branch July 8, 2023 23:56
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.

Sidebar flex changes banner alignment issue
4 participants