mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: added time-ago to toggle-list
This commit is contained in:
parent
f5ed3eaa1f
commit
303b6edb99
@ -38,7 +38,9 @@
|
|||||||
"prepublish": "npm run build"
|
"prepublish": "npm run build"
|
||||||
},
|
},
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"react-timeago": "^4.4.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.9.0",
|
"@babel/core": "^7.9.0",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
|
@ -81,3 +81,8 @@
|
|||||||
text-transform: none;
|
text-transform: none;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.toggleName {
|
||||||
|
color: #37474f !important;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Switch, Chip, ListItem, ListItemAction, Icon } from 'react-mdl';
|
import { Switch, Chip, ListItem, ListItemAction, Icon } from 'react-mdl';
|
||||||
|
import TimeAgo from 'react-timeago';
|
||||||
import Progress from './progress';
|
import Progress from './progress';
|
||||||
import { UPDATE_FEATURE } from '../../permissions';
|
import { UPDATE_FEATURE } from '../../permissions';
|
||||||
import { calc, styles as commonStyles } from '../common';
|
import { calc, styles as commonStyles } from '../common';
|
||||||
@ -18,7 +19,7 @@ const Feature = ({
|
|||||||
revive,
|
revive,
|
||||||
hasPermission,
|
hasPermission,
|
||||||
}) => {
|
}) => {
|
||||||
const { name, description, enabled, type, stale } = feature;
|
const { name, description, enabled, type, stale, createdAt } = feature;
|
||||||
const { showLastHour = false } = settings;
|
const { showLastHour = false } = settings;
|
||||||
const isStale = showLastHour ? metricsLastHour.isFallback : metricsLastMinute.isFallback;
|
const isStale = showLastHour ? metricsLastHour.isFallback : metricsLastMinute.isFallback;
|
||||||
const percent =
|
const percent =
|
||||||
@ -47,7 +48,10 @@ const Feature = ({
|
|||||||
</span>
|
</span>
|
||||||
<span className={['mdl-list__item-primary-content', styles.listItemLink].join(' ')}>
|
<span className={['mdl-list__item-primary-content', styles.listItemLink].join(' ')}>
|
||||||
<Link to={featureUrl} className={[commonStyles.listLink, commonStyles.truncate].join(' ')}>
|
<Link to={featureUrl} className={[commonStyles.listLink, commonStyles.truncate].join(' ')}>
|
||||||
{name}
|
<span className={commonStyles.toggleName}>{name} </span>
|
||||||
|
<small className="mdl-color-text--blue-grey-300">
|
||||||
|
<TimeAgo date={createdAt} />
|
||||||
|
</small>
|
||||||
<span className={['mdl-list__item-sub-title', commonStyles.truncate].join(' ')}>{description}</span>
|
<span className={['mdl-list__item-sub-title', commonStyles.truncate].join(' ')}>{description}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user