-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #458 from gemini-testing/HERMIONE-850.db_popup
fix: db popup inconsistent position
- Loading branch information
Showing
2 changed files
with
39 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {Ref, Button} from 'semantic-ui-react'; | ||
import classNames from 'classnames'; | ||
|
||
const DbBtn = ({fetchDbDetails}, ref) => { | ||
const successFetchDbDetails = fetchDbDetails.filter(d => d.success); | ||
const isFailed = successFetchDbDetails.length !== fetchDbDetails.length; | ||
const value = `${successFetchDbDetails.length}/${fetchDbDetails.length}`; | ||
const content = `Databases loaded: ${value}`; | ||
const className = classNames( | ||
'db-info', | ||
{'db-info_failed': isFailed} | ||
); | ||
|
||
return ( | ||
<Ref innerRef={ref}> | ||
<Button | ||
content={content} | ||
icon="angle down" | ||
className={className} | ||
basic | ||
/> | ||
</Ref> | ||
); | ||
}; | ||
|
||
const ForwardedDbBtn = React.forwardRef(DbBtn); | ||
|
||
ForwardedDbBtn.propTypes = { | ||
fetchDbDetails: PropTypes.arrayOf(PropTypes.shape({ | ||
success: PropTypes.bool | ||
})).isRequired | ||
}; | ||
|
||
export default ForwardedDbBtn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters