11import * as React from 'react' ;
22import styled from 'styled-components' ;
3-
4- import { InformationPanel } from './sidePanelMolecules/Headers'
5- import { Grommet } from "grommet" ;
6- import { grommet } from 'grommet/themes' ;
7- import { License , CircleInformation } from 'grommet-icons' ;
8-
3+ import { InformationPanel } from './sidePanelMolecules/titles'
94
105interface ISidePanelTableWrapperProps {
116 sidePanelVisibility : boolean ;
127}
138
149const SidePanelTableListWrapper = styled . div < ISidePanelTableWrapperProps > `
1510 color: black;
16- padding: 20px;
17- width: 250px;
18- background-color: transparent;
11+ padding: 40px;
12+ width: ${ ( { sidePanelVisibility } ) =>
13+ sidePanelVisibility ? '300px' : '0px' } ;
14+ height: 100vh;
15+ background-color: white;
16+ color: black;
1917 transition: width 500ms ease-in-out;
2018` ;
2119
2220const InfoSection = styled . div `
2321 overflow-wrap: break-word;
24- padding: 30px 0px;
2522` ;
2623
24+
25+
2726const Text = styled . p `
28- font-family: 'Poppins', sans-serif ;
27+ font-size: 100% ;
2928 color: black;
30- font-size: 14px;
31- font-weight: bold;
32- padding: 1px 5px;
33- :hover{
34- background-color: #f4f4f4;
35- }
3629` ;
3730
38- const LabelTextWrapper = styled . div `
39- margin: 5px 0px;
40- `
41-
4231const Label = styled . label `
43- font-size: 12px;
44- padding: 2px 5px;
32+ font-size: 80%;
4533 color: black;
46- font-family: 'Poppins', sans-serif;
4734` ;
4835
49- const EmptyState = styled . div `
50- padding: 40px 0px;
51- font-size: 18px;
52- `
53-
5436interface ISelectedTable {
5537 columns ?: any [ ] ;
5638 foreignKeys ?: any [ ] ;
@@ -83,8 +65,8 @@ const InfoPanel: React.SFC<Props> = ({
8365 foreignKeyRelationships . push (
8466 < li >
8567 < Text key = { key } >
86- { key . column_name } from table
87- { key . foreign_table_name } , { key . foreign_column_name }
68+ { key . column_name } < Label as = "span" > from table</ Label >
69+ { key . foreign_table_name } ( { key . foreign_column_name } )
8870 </ Text >
8971 </ li >
9072 ) ;
@@ -94,7 +76,7 @@ const InfoPanel: React.SFC<Props> = ({
9476 for ( const foreignTableOfPrimary in foreignKeysOfPrimary ) {
9577 primaryKeyRelationships . push (
9678 < li >
97- < Text > { foreignTableOfPrimary } , { foreignKeysOfPrimary [ foreignTableOfPrimary ] } </ Text >
79+ { foreignTableOfPrimary } ( { foreignKeysOfPrimary [ foreignTableOfPrimary ] } )
9880 </ li >
9981 ) ;
10082 }
@@ -126,9 +108,15 @@ const InfoPanel: React.SFC<Props> = ({
126108 < ul > { foreignKeyRelationships } </ ul >
127109 </ div >
128110 ) }
129- </ SidePanelTableListWrapper >
130- < / G r o m m e t >
111+ </ InfoSection >
112+ ) : (
113+ < div >
114+ You haven't selected a table yet, click on a table to see their
115+ information
116+ </ div >
117+ ) }
118+ </ SidePanelTableListWrapper >
131119 ) ;
132120} ;
133121
134- export default InfoPanel;
122+ export default InfoPanel ;
0 commit comments