Skip to content

Commit

Permalink
Fix layout positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Oct 3, 2023
1 parent b54797d commit baea808
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const Dialog = ({

return (
<Drawer
mode="side"
title={
<Box gap="0.5rem">
<StyledTableIcon size="20px" />
Expand Down
7 changes: 6 additions & 1 deletion packages/web-console/src/scenes/Editor/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,12 @@ const Menu = () => {
mode="side"
title="QuestDB News"
withCloseButton
onOpenChange={setNewsOpened}
onOpenChange={(newsOpened) => {
setNewsOpened(newsOpened)
dispatch(
actions.console.setActivePanel(newsOpened ? "news" : "console"),
)
}}
trigger={
<IconWithTooltip
icon={
Expand Down
12 changes: 9 additions & 3 deletions packages/web-console/src/scenes/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ const Root = styled.div`
height: 100%;
`

const Main = styled.div`
const Main = styled.div<{ sideOpened: boolean }>`
flex: 1;
width: ${({ sideOpened }) => (sideOpened ? "calc(100% - 50rem)" : "100%")};
`

const Drawer = styled.div`
Expand All @@ -73,9 +74,14 @@ const Layout = () => {
return (
<QuestProvider>
<Root>
<Main>
<Main sideOpened={activePanel === "news"}>
<Page
style={{ display: activePanel === "console" ? "flex" : "none" }}
style={{
display:
activePanel === "console" || activePanel === "news"
? "flex"
: "none",
}}
>
<Console />
</Page>
Expand Down

0 comments on commit baea808

Please sign in to comment.