Rotate Styling for Vertical Sidebar
Summary: - We are using the `Sidebar` component in our `LogViewer` implementation and we noticed that it needed some styling updates to be used properly as a vertical `Sidebar`. Reviewed By: mweststrate Differential Revision: D32083159 fbshipit-source-id: 441f3972ae900b5d5f353d3c7b56117c489850ba
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9975aa9319
commit
67b4b53c20
@@ -230,42 +230,50 @@ const GutterWrapper = ({
|
|||||||
</Layout.Right>
|
</Layout.Right>
|
||||||
);
|
);
|
||||||
case 'bottom':
|
case 'bottom':
|
||||||
// TODO: needs rotated styling
|
|
||||||
return (
|
return (
|
||||||
<Layout.Top>
|
<Layout.Top>
|
||||||
<VerticalGutter enabled={!!children} />
|
<VerticalGutter enabled={!!children} rotateStyling />
|
||||||
{children}
|
{children}
|
||||||
</Layout.Top>
|
</Layout.Top>
|
||||||
);
|
);
|
||||||
case 'top':
|
case 'top':
|
||||||
// TODO: needs rotated styling
|
|
||||||
return (
|
return (
|
||||||
<Layout.Bottom>
|
<Layout.Bottom>
|
||||||
{children}
|
{children}
|
||||||
<VerticalGutter enabled={!!children} />
|
<VerticalGutter enabled={!!children} rotateStyling />
|
||||||
</Layout.Bottom>
|
</Layout.Bottom>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const VerticalGutterContainer = styled('div')<{enabled: boolean}>(
|
const VerticalGutterContainer = styled('div')<{
|
||||||
({enabled}) => ({
|
enabled: boolean;
|
||||||
width: theme.space.large,
|
rotateStyling?: boolean;
|
||||||
minWidth: theme.space.large,
|
}>(({enabled, rotateStyling}) => ({
|
||||||
|
width: rotateStyling ? '100%' : theme.space.large,
|
||||||
|
minWidth: rotateStyling ? '100%' : theme.space.large,
|
||||||
cursor: enabled ? undefined : 'default', // hide cursor from interactive container
|
cursor: enabled ? undefined : 'default', // hide cursor from interactive container
|
||||||
color: enabled ? theme.textColorPlaceholder : theme.backgroundWash,
|
color: enabled ? theme.textColorPlaceholder : theme.backgroundWash,
|
||||||
fontSize: '16px',
|
fontSize: '16px',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: rotateStyling ? 'column' : 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
background: theme.backgroundWash,
|
background: theme.backgroundWash,
|
||||||
':hover': {
|
':hover': {
|
||||||
background: enabled ? theme.dividerColor : undefined,
|
background: enabled ? theme.dividerColor : undefined,
|
||||||
},
|
},
|
||||||
}),
|
'& svg': {
|
||||||
);
|
transform: rotateStyling ? 'rotate(90deg)' : undefined,
|
||||||
const VerticalGutter = ({enabled}: {enabled: boolean}) => (
|
},
|
||||||
<VerticalGutterContainer enabled={enabled}>
|
}));
|
||||||
|
const VerticalGutter = ({
|
||||||
|
enabled,
|
||||||
|
rotateStyling,
|
||||||
|
}: {
|
||||||
|
enabled: boolean;
|
||||||
|
rotateStyling?: boolean;
|
||||||
|
}) => (
|
||||||
|
<VerticalGutterContainer enabled={enabled} rotateStyling={rotateStyling}>
|
||||||
<MoreOutlined />
|
<MoreOutlined />
|
||||||
</VerticalGutterContainer>
|
</VerticalGutterContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user