1
1
import * as React from 'react' ;
2
2
import 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'
9
4
10
5
interface ISidePanelTableWrapperProps {
11
6
sidePanelVisibility : boolean ;
12
7
}
13
8
14
9
const SidePanelTableListWrapper = styled . div < ISidePanelTableWrapperProps > `
15
10
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;
19
17
transition: width 500ms ease-in-out;
20
18
` ;
21
19
22
20
const InfoSection = styled . div `
23
21
overflow-wrap: break-word;
24
- padding: 30px 0px;
25
22
` ;
26
23
24
+
25
+
27
26
const Text = styled . p `
28
- font-family: 'Poppins', sans-serif ;
27
+ font-size: 100% ;
29
28
color: black;
30
- font-size: 14px;
31
- font-weight: bold;
32
- padding: 1px 5px;
33
- :hover{
34
- background-color: #f4f4f4;
35
- }
36
29
` ;
37
30
38
- const LabelTextWrapper = styled . div `
39
- margin: 5px 0px;
40
- `
41
-
42
31
const Label = styled . label `
43
- font-size: 12px;
44
- padding: 2px 5px;
32
+ font-size: 80%;
45
33
color: black;
46
- font-family: 'Poppins', sans-serif;
47
34
` ;
48
35
49
- const EmptyState = styled . div `
50
- padding: 40px 0px;
51
- font-size: 18px;
52
- `
53
-
54
36
interface ISelectedTable {
55
37
columns ?: any [ ] ;
56
38
foreignKeys ?: any [ ] ;
@@ -83,8 +65,8 @@ const InfoPanel: React.SFC<Props> = ({
83
65
foreignKeyRelationships . push (
84
66
< li >
85
67
< 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 } )
88
70
</ Text >
89
71
</ li >
90
72
) ;
@@ -94,7 +76,7 @@ const InfoPanel: React.SFC<Props> = ({
94
76
for ( const foreignTableOfPrimary in foreignKeysOfPrimary ) {
95
77
primaryKeyRelationships . push (
96
78
< li >
97
- < Text > { foreignTableOfPrimary } , { foreignKeysOfPrimary [ foreignTableOfPrimary ] } </ Text >
79
+ { foreignTableOfPrimary } ( { foreignKeysOfPrimary [ foreignTableOfPrimary ] } )
98
80
</ li >
99
81
) ;
100
82
}
@@ -126,9 +108,15 @@ const InfoPanel: React.SFC<Props> = ({
126
108
< ul > { foreignKeyRelationships } </ ul >
127
109
</ div >
128
110
) }
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 >
131
119
) ;
132
120
} ;
133
121
134
- export default InfoPanel;
122
+ export default InfoPanel ;
0 commit comments