mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 17:16:01 +00:00
bold current connection
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user