mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
database widget
This commit is contained in:
parent
30af732820
commit
0dba0d3a68
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user