mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 18:56:00 +00:00
resizable widget container
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import theme from '../theme';
|
||||
import { useLeftPanelWidth } from '../utility/globalState';
|
||||
|
||||
export const SearchBoxWrapper = styled.div`
|
||||
display: flex;
|
||||
@@ -15,21 +18,31 @@ export const WidgetsMainContainer = styled.div`
|
||||
user-select: none;
|
||||
`;
|
||||
|
||||
export const WidgetsOuterContainer = styled.div`
|
||||
const StyledWidgetsOuterContainer = styled.div`
|
||||
flex: 1 1 0;
|
||||
overflow: hidden;
|
||||
width: ${theme.leftPanel.width}px;
|
||||
width: ${(props) => props.leftPanelWidth}px;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
`;
|
||||
|
||||
export const WidgetsInnerContainer = styled.div`
|
||||
export function WidgetsOuterContainer({ children }) {
|
||||
const leftPanelWidth = useLeftPanelWidth();
|
||||
return <StyledWidgetsOuterContainer leftPanelWidth={leftPanelWidth}>{children}</StyledWidgetsOuterContainer>;
|
||||
}
|
||||
|
||||
export const StyledWidgetsInnerContainer = styled.div`
|
||||
flex: 1 1;
|
||||
overflow: scroll;
|
||||
width: ${theme.leftPanel.width}px;
|
||||
width: ${(props) => props.leftPanelWidth}px;
|
||||
`;
|
||||
|
||||
export function WidgetsInnerContainer({ children }) {
|
||||
const leftPanelWidth = useLeftPanelWidth();
|
||||
return <StyledWidgetsInnerContainer leftPanelWidth={leftPanelWidth}>{children}</StyledWidgetsInnerContainer>;
|
||||
}
|
||||
|
||||
export const Input = styled.input`
|
||||
flex: 1;
|
||||
min-width: 90px;
|
||||
|
||||
Reference in New Issue
Block a user