Emails: Fix mailbox list background and position#101687
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
b593a8c to
8af0782
Compare
fredrikekelund
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround, @m1r0 👍
This PR fixes the changes, but I would argue we should apply the styling to the existing component structure instead of adding a VerticalNav component here (given that the children aren't VerticalNavItems)
| <div className="vertical-nav"> | ||
| <SectionHeader | ||
| isPlaceholder={ isPlaceholder } | ||
| label={ | ||
| <> | ||
| { !! showIcon && domain && <HeaderIcon /> } | ||
| { getListHeaderTextForAccountType() } | ||
| </> | ||
| } | ||
| > | ||
| { addMailboxPath && ( | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-expect-error | ||
| <Button href={ addMailboxPath } variant="link" disabled={ !! disableActions }> | ||
| { translate( 'Add mailbox' ) } | ||
| </Button> | ||
| ) } | ||
| { showContextMenu && ( | ||
| <ContextMenu | ||
| domain={ domain } | ||
| className="email-plan-mailboxes-list__mailbox-context-menu" | ||
| /> | ||
| ) } | ||
| </SectionHeader> | ||
| { children } | ||
| </div> |
There was a problem hiding this comment.
| <div className="vertical-nav"> | |
| <SectionHeader | |
| isPlaceholder={ isPlaceholder } | |
| label={ | |
| <> | |
| { !! showIcon && domain && <HeaderIcon /> } | |
| { getListHeaderTextForAccountType() } | |
| </> | |
| } | |
| > | |
| { addMailboxPath && ( | |
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | |
| // @ts-expect-error | |
| <Button href={ addMailboxPath } variant="link" disabled={ !! disableActions }> | |
| { translate( 'Add mailbox' ) } | |
| </Button> | |
| ) } | |
| { showContextMenu && ( | |
| <ContextMenu | |
| domain={ domain } | |
| className="email-plan-mailboxes-list__mailbox-context-menu" | |
| /> | |
| ) } | |
| </SectionHeader> | |
| { children } | |
| </div> | |
| <SectionHeader | |
| isPlaceholder={ isPlaceholder } | |
| label={ | |
| <> | |
| { !! showIcon && domain && <HeaderIcon /> } | |
| { getListHeaderTextForAccountType() } | |
| </> | |
| } | |
| > | |
| { addMailboxPath && ( | |
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | |
| <Button href={ addMailboxPath } variant="link" disabled={ !! disableActions }> | |
| { translate( 'Add mailbox' ) } | |
| </Button> | |
| ) } | |
| { showContextMenu && ( | |
| <ContextMenu | |
| domain={ domain } | |
| className="email-plan-mailboxes-list__mailbox-context-menu" | |
| /> | |
| ) } | |
| </SectionHeader> | |
| { children } |
It looks like the only purpose vertical-nav is to add a margin-top: 15px rule in the single-site context. Applying that style to email-plan-mailboxes-list__mailbox-list directly seems sensible, since we're not using VerticalNavItem here.
Side note: the // @ts-expect-error looks to be superfluous unless I'm missing something.
There was a problem hiding this comment.
Thanks for the quick review, Fredrik. All makes sense! I've moved the styling to the component and cleaned up the vertical-nav (not sure why I went with the div instead of the component). Can you give it another quick look? There should be no visual changes.
Regarding the @ts-expect-error, I've tried removing it but that unveiled a strange TypeScript error related to the href. 🤷 I wasn't able to find a reasonable explanation, so I'm leaving it for now.
fredrikekelund
left a comment
There was a problem hiding this comment.
Looking good and tests well 👍 Thanks for the update and sorry for my delayed second review, @m1r0
Resolves #101651
Proposed Changes
Why are these changes being made?
Testing Instructions
/email/:domain/manage/:site./overview/site-domain/email/:site/:domainand/domains/manage/all/email/:site/:domainand make sure the "Mailboxes" section looks good.Screenshots
/email/:domain/manage/:site:/overview/site-domain/email/:site/:domain:/domains/manage/all/email/:site/:domain:Pre-merge Checklist