Skip to content

Commit

Permalink
Revert "Create table - make it a side modal"
Browse files Browse the repository at this point in the history
This reverts commit da4e9a3.
  • Loading branch information
insmac committed Oct 5, 2023
1 parent da4e9a3 commit 4def08d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
12 changes: 0 additions & 12 deletions packages/web-console/src/components/TableSchemaDialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { Action, SchemaColumn, SchemaFormValues } from "./types"
import Joi from "joi"
import { isValidTableName } from "./isValidTableName"
import * as QuestDB from "../../utils/questdb"
import { useDispatch } from "react-redux"
import { actions } from "../../store"

const StyledTableIcon = styled(TableIcon)`
color: ${({ theme }) => theme.color.foreground};
Expand Down Expand Up @@ -79,8 +77,6 @@ export const Dialog = ({
tables,
ctaText,
}: Props) => {
const dispatch = useDispatch()

const formDefaults = {
name,
schemaColumns: schema,
Expand Down Expand Up @@ -163,7 +159,6 @@ export const Dialog = ({

return (
<Drawer
mode={action === "add" ? "side" : "modal"}
title={
<Box gap="0.5rem">
<StyledTableIcon size="20px" />
Expand All @@ -188,13 +183,6 @@ export const Dialog = ({
</Button>
)
}
onOpenChange={(isOpen) => {
if (isOpen && action === "add") {
dispatch(
actions.console.setActivePanel(isOpen ? "create" : "console"),
)
}
}}
onDismiss={() => {
resetToDefaults()
onOpenChange(undefined)
Expand Down
10 changes: 4 additions & 6 deletions packages/web-console/src/scenes/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,16 @@ const Layout = () => {
window.bus.trigger(BusEvent.REACT_READY)
}, [])

const isSideOpened = () => {
return ["create", "news"].includes(activePanel)
}

return (
<QuestProvider>
<Root>
<Main sideOpened={isSideOpened()}>
<Main sideOpened={activePanel === "news"}>
<Page
style={{
display:
activePanel === "console" || isSideOpened() ? "flex" : "none",
activePanel === "console" || activePanel === "news"
? "flex"
: "none",
}}
>
<Console />
Expand Down
2 changes: 1 addition & 1 deletion packages/web-console/src/store/Console/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type QueryGroup = {
queries: Query[]
}

export type Panel = "console" | "settings" | "news" | "import" | "create"
export type Panel = "console" | "settings" | "news" | "import"

export type ConsoleConfigShape = Readonly<{
githubBanner: boolean
Expand Down

0 comments on commit 4def08d

Please sign in to comment.