-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge: + client: add detailed date format for filters
Close #624 Squashed commit of the following: commit 5a66d8c Author: Artem Baskal <a.baskal@adguard.com> Date: Mon Jan 20 19:16:27 2020 +0300 update CellWrap logic commit 0725864 Author: Artem Baskal <a.baskal@adguard.com> Date: Mon Jan 20 15:37:26 2020 +0300 fix invalid date case commit bd2a21f Author: Artem Baskal <a.baskal@adguard.com> Date: Fri Jan 17 18:44:23 2020 +0300 + client: add detailed date format for filters
- Loading branch information
1 parent
ce7f1e2
commit ac156b9
Showing
8 changed files
with
62 additions
and
64 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
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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const CellWrap = ({ value }) => ( | ||
<div className="logs__row logs__row--overflow"> | ||
<span className="logs__text logs__text--full" title={value}> | ||
{value} | ||
</span> | ||
</div> | ||
); | ||
const CellWrap = ({ value }, formatValue, formatTitle = formatValue) => { | ||
if (!value) { | ||
return '–'; | ||
} | ||
const cellValue = typeof formatValue === 'function' ? formatValue(value) : value; | ||
const cellTitle = typeof formatTitle === 'function' ? formatTitle(value) : value; | ||
|
||
return ( | ||
<div className="logs__row logs__row--overflow"> | ||
<span className="logs__text logs__text--full" title={cellTitle}> | ||
{cellValue} | ||
</span> | ||
</div> | ||
); | ||
}; | ||
|
||
CellWrap.propTypes = { | ||
value: PropTypes.oneOfType([ | ||
PropTypes.string, | ||
PropTypes.number, | ||
]), | ||
formatValue: PropTypes.func, | ||
formatTitle: PropTypes.func, | ||
}; | ||
|
||
export default CellWrap; |
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
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