Skip to content

Commit

Permalink
Change bg color for current and connected dbs
Browse files Browse the repository at this point in the history
The active DB is yellow and the other connecteds is blue.
  • Loading branch information
maxcnunes committed Nov 6, 2016
1 parent 662c312 commit 4d3d1dc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/renderer/components/database-list-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ const STYLE = {
padding: '0.92857143em 1.14285714em',
display: 'block',
},
activeDatabase: {
backgroundColor: '#FFFAF3',
boxShadow: '0 0 0 1px #C9BA9B inset,0 0 0 0 transparent',
},
loadedDatabase: {
backgroundColor: '#F8FFFF',
},
};


Expand Down Expand Up @@ -158,8 +165,17 @@ export default class DatabaseListItem extends Component {
filteredProcedures = this.filterItems(filter, procedures);
}

const isCurrentDB = currentDB === database.name;

let styleComponent = {};
if (isCurrentDB) {
styleComponent = STYLE.activeDatabase;
} else if (this.isMetadataLoaded()) {
styleComponent = STYLE.loadedDatabase;
}

return (
<div className={`item ${currentDB === database.name ? 'active' : ''}`}>
<div className={`item ${isCurrentDB ? 'active' : ''}`} style={styleComponent}>
{this.renderHeader(database)}
<div className="ui list" style={cssStyleItems}>
<div className="item" style={cssStyleItems}>
Expand Down

0 comments on commit 4d3d1dc

Please sign in to comment.