bold current connection

This commit is contained in:
Jan Prochazka
2020-04-04 18:36:16 +02:00
parent 7de37ad7e5
commit 93cacafa4b
7 changed files with 73 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react';
import _ from 'lodash';
import { DatabaseIcon } from '../icons';
import { DropDownMenuItem } from '../modals/DropDownMenu';
import showModal from '../modals/showModal';
@@ -20,10 +21,20 @@ function Menu({ data, makeAppObj }) {
);
}
export default function databaseAppObject({ name }) {
const databaseAppObject = flags => ({ name, connection }) => {
const { boldCurrentDatabase } = flags || {};
const title = name;
const key = name;
const Icon = DatabaseIcon;
const isBold = boldCurrentDatabase
? ({ currentDatabase }) => {
return (
_.get(currentDatabase, 'connection._id') == _.get(connection, '_id') && _.get(currentDatabase, 'name') == name
);
}
: null;
return { title, key, Icon, Menu };
}
return { title, key, Icon, Menu, isBold };
};
export default databaseAppObject;