Skip to content

Commit

Permalink
add sidebar alignment option
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Oct 10, 2023
1 parent f5fa241 commit 326349c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/web-console/src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import styled from "styled-components"
import { Box } from "../Box"

export const Sidebar = styled(Box).attrs({ flexDirection: "column" })`
export const Sidebar = styled(Box).attrs({ flexDirection: "column" })<{align?: "top" | "bottom"}>`
width: 4.5rem;
height: 100%;
background: ${({ theme }) => theme.color.backgroundDarker};
gap: 0;
flex-shrink: 0;
justify-content: ${({align}) => align === "top" ? "flex-start" : "flex-end"};
`
2 changes: 1 addition & 1 deletion packages/web-console/src/scenes/Console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const Console = () => {
onChange={handleEditorSplitterChange}
>
<Top>
<Sidebar>
<Sidebar align="top">
<PopperHover
delay={350}
placement="bottom"
Expand Down
2 changes: 1 addition & 1 deletion packages/web-console/src/scenes/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const Layout = () => {

<Drawer id="side-panel-right" />

<Sidebar>
<Sidebar align="top">
<DropdownMenu.Root modal={false}>
<DropdownMenu.Trigger asChild>
<PrimaryToggleButton>
Expand Down

0 comments on commit 326349c

Please sign in to comment.