mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 22:36:01 +00:00
database widget
This commit is contained in:
@@ -4,6 +4,7 @@ import styled from 'styled-components';
|
||||
import FilesTabsPanel from './FilesTabsPanel';
|
||||
import WidgetIconPanel from './widgets/WidgetIconPanel';
|
||||
import useCurrentWidget from './widgets/useCurrentWidget';
|
||||
import WidgetContainer from './widgets/WidgetContainer';
|
||||
|
||||
const BodyDiv = styled.div`
|
||||
position: fixed;
|
||||
@@ -59,7 +60,11 @@ export default function Screen({ children }) {
|
||||
<IconBar>
|
||||
<WidgetIconPanel />
|
||||
</IconBar>
|
||||
{!!currentWidget && <LeftPanel></LeftPanel>}
|
||||
{!!currentWidget && (
|
||||
<LeftPanel>
|
||||
<WidgetContainer />
|
||||
</LeftPanel>
|
||||
)}
|
||||
<TabsPanel leftPanelWidth={leftPanelWidth}>
|
||||
<FilesTabsPanel></FilesTabsPanel>
|
||||
</TabsPanel>
|
||||
|
||||
5
web/src/widgets/DatabaseWidget.js
Normal file
5
web/src/widgets/DatabaseWidget.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
export default function DatabaseWidget() {
|
||||
return <button onClick={() => {}}>Add connection</button>;
|
||||
}
|
||||
9
web/src/widgets/WidgetContainer.js
Normal file
9
web/src/widgets/WidgetContainer.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
import useCurrentWidget from './useCurrentWidget';
|
||||
import DatabaseWidget from './DatabaseWidget';
|
||||
|
||||
export default function WidgetContainer() {
|
||||
const currentWidget = useCurrentWidget();
|
||||
if (currentWidget === 'database') return <DatabaseWidget />;
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user