Skip to content

Commit

Permalink
Better code for side_bar tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Akronix committed Sep 5, 2018
1 parent 96cfc75 commit 1e07668
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 43 deletions.
74 changes: 35 additions & 39 deletions side_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def group_metrics_in_accordion(metrics, metric_category):
style={'color': 'white'},
id='metrics-tab-container',
),
#~ select_time_axis_control(),
],
id='metrics-tab'
);
Expand Down Expand Up @@ -232,40 +231,38 @@ def selection_result_container():


def generate_tabs(wikis, metrics):
return ([gdc.Tabs(
tabs=[
{'value': 'wikis', 'label': 'WIKIS'},
{'value': 'metrics', 'label': 'METRICS'}
],
value='wikis',
id='side-bar-tabs',
vertical=False,
selectedTabStyle={
'backgroundColor': '#004481',
},
selectedTabClassName='side-bar-selected-tab',
style={
'width': '100%',
'textAlign': 'center',
'border': 'none',
},
tabsStyle={
'width': '50%',
'height': '70px',
'borderRadius': '3px',
'backgroundColor': '#072146',
'borderLeftStyle': 'none',
'borderRightStyle': 'none',
'fontSize': '18px',
'lineHeight': '21px',
'justifyContent': 'center',
'flexDirection': 'column'
},
tabsClassName='side-bar-tab',
),
wikis_tab(wikis),
metrics_tab(metrics)
]);
return (html.Div([
gdc.Tabs(
tabs=[
{'value': 'wikis', 'label': 'WIKIS'},
{'value': 'metrics', 'label': 'METRICS'}
],
value='wikis',
id='side-bar-tabs',
vertical=False,
selectedTabStyle={
'backgroundColor': '#004481',
},
selectedTabClassName='side-bar-selected-tab',
style={
'width': '100%',
'textAlign': 'center',
'border': 'none',
},
tabsStyle={
'backgroundColor': '#072146',
'borderRadius': '3px',
'borderLeftStyle': 'none',
'borderRightStyle': 'none',
},
tabsClassName='side-bar-tab',
),
wikis_tab(wikis),
metrics_tab(metrics)
],
id='side-bar-tabs-container',
)
);


def generate_side_bar(wikis, metrics):
Expand All @@ -274,11 +271,10 @@ def generate_side_bar(wikis, metrics):
fold_button(),
html.Div(id='side-bar-content',
children = [
#~ html.Div(style={'backgroundColor': '#072146', 'height': '15px'}),
] + generate_tabs(wikis, metrics) +
[compare_button(),
generate_tabs(wikis, metrics),
compare_button(),
selection_result_container()
]
]
)
]
);
Expand Down
4 changes: 0 additions & 4 deletions styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ p#fold-button {
.side-bar-tab {
width: 50%;
height: 70px;
border-radius: 3px;
background-color: #072146;
color: #49A5E6;
border-left-style: none;
border-right-style: none;
font-size: 18px;
line-height: 21px;
justify-content: center;
Expand Down

0 comments on commit 1e07668

Please sign in to comment.