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 harmony docs sidebar-item #6690

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions packages/harmony/src/storybook/components/SidebarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import { jsx } from '@emotion/react'
import { useTheme } from '@storybook/theming'

import { Box } from '../../components/layout/Box'
import { Flex } from '../../components/layout/Flex'

type SidebarItemProps = {
name: string
status: string
Expand All @@ -22,19 +19,25 @@ export const SidebarItem = (props: SidebarItemProps) => {
: theme.barSelectedColor

return (
<Flex justifyContent='space-between' w='100%'>
<Box as='div'>{name}</Box>
<Flex
justifyContent='center'
alignItems='center'
as='div'
ph='s'
borderRadius='s'
border='default'
css={{ height: '18px', borderColor: statusColor, color: statusColor }}
<div
css={{ display: 'flex', justifyContent: 'space-between', width: '100%' }}
>
<span>{name}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the Box was a div before, not a span. Not sure if that matters here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i checked, seemed to not matter

<div
Comment on lines +22 to +26
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does removing the Flex and Box fix this?

Copy link
Contributor Author

@dylanjeffers dylanjeffers Nov 14, 2023

Choose a reason for hiding this comment

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

tried to explain in description, but we dont have access to the theme in the manager context, which includes the side-bar

Copy link
Contributor

Choose a reason for hiding this comment

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

ah i didnt read it, just went to the code lol

css={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: 18,
paddingLeft: 8,
paddingRight: 8,
borderRadius: 4,
border: `1px solid ${statusColor}`,
color: statusColor
}}
>
{status}
</Flex>
</Flex>
</div>
</div>
)
}