Skip to content

Commit

Permalink
fix: sidebar styling
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Dec 23, 2020
1 parent c34c592 commit 9750307
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ The sidebar items are also [ActionBar](/api/components-actionbar--overview) and
if (!title) {
actions.push({ id: 'title', hidden: true })
}
if (!filter) {
actions.push({ id: 'filter', hidden: true })
if (filter) {
actions.push({ id: 'filter', hidden: false })
}
return (
<Fragment>
Expand All @@ -389,7 +389,7 @@ The sidebar items are also [ActionBar](/api/components-actionbar--overview) and
</svg>
</Box>
),
},${!title ? `\n { id: 'title', hidden: true },` : ''}${!filter ? `\n { id: 'filter', hidden: true },` : ''}
},${!title ? `\n { id: 'title', hidden: true },` : ''}${filter ? `\n { id: 'filter', hidden: false },` : ''}
]
}`}
</Source>
Expand Down
4 changes: 3 additions & 1 deletion ui/app/src/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const Sidebar: FC<SidebarProps> = ({
return acc;
}, menuItems);
}
const actions: ActionItems = [...sidebar];
const actions: ActionItems = [];
if (propsTitle || label) {
actions.push({
node: (
Expand All @@ -231,7 +231,9 @@ export const Sidebar: FC<SidebarProps> = ({
</Box>
),
id: 'filter',
hidden: true,
});
actions.push(...sidebar);
return (
<AppSidebar variant="appsidebar.sidebar" id="sidebar">
{responsive && (
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/ActionBar/ActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export const ActionBar: FC<ActionBarProps> = ({
return (
<Box
key={`${typeof node === 'string' ? node : 'item'}_${index}`}
variant={`${themeKey}.item`}
sx={{
mr: index === 0 ? 1 : 0,
ml: nextGroup !== group || group === undefined ? 2 : 1,
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
variant: `${themeKey}.item`,
}}
>
{typeof node === 'string' ? (
Expand Down
9 changes: 8 additions & 1 deletion ui/components/src/ThemeContext/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ export const theme: ControlsTheme = {
default: {
overflowX: 'hidden',
position: 'sticky',
top: '5rem',
top: '4.5rem',
maxWidth: '300px',
overflowY: 'auto',
backgroundColor: 'background',
Expand Down Expand Up @@ -962,6 +962,9 @@ export const theme: ControlsTheme = {
fontSize: 1,
color: 'mutedText',
fontWeight: 'body',
':hover': {
textDecoration: 'underline',
},
},
toggle: {
position: 'fixed',
Expand All @@ -975,6 +978,9 @@ export const theme: ControlsTheme = {
display: 'flex',
flexDirection: 'column',
},
item: {
ml: 0,
},
items: {
my: 2,
},
Expand All @@ -986,6 +992,7 @@ export const theme: ControlsTheme = {
display: 'flex',
flexDirection: 'column',
px: 2,
mb: 2,
},
},
appheader: {
Expand Down

0 comments on commit 9750307

Please sign in to comment.