mirror of
https://github.com/SomboChea/ui
synced 2024-11-28 00:44:30 +07:00
fix: version rendering issue. (#38)
* fix: object passing for react rendering * fix: const for 'not available' * fix: const for 'not available'
This commit is contained in:
parent
fc114298ad
commit
e8fd59696e
@ -11,6 +11,8 @@ import ListItem from '@material-ui/core/ListItem/index';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { DIST_TAGS } from '../../../lib/constants';
|
import { DIST_TAGS } from '../../../lib/constants';
|
||||||
|
|
||||||
|
const NOT_AVAILABLE = 'Not available';
|
||||||
|
|
||||||
class Versions extends React.PureComponent<any> {
|
class Versions extends React.PureComponent<any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
@ -32,7 +34,8 @@ class Versions extends React.PureComponent<any> {
|
|||||||
<ListItem className={'version-item'} key={version}>
|
<ListItem className={'version-item'} key={version}>
|
||||||
<ListItemText>{version}</ListItemText>
|
<ListItemText>{version}</ListItemText>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<ListItemText>{isVersion && timeMap[version] ? `${formatDateDistance(timeMap[version])} ago` : packages[version]}</ListItemText>
|
{isVersion && <ListItemText>{timeMap[version] ? `${formatDateDistance(timeMap[version])} ago` : NOT_AVAILABLE}</ListItemText>}
|
||||||
|
{isVersion === false && <ListItemText>{packages[version]}</ListItemText>}
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
|
Loading…
Reference in New Issue
Block a user