diff --git a/src/components/SyncAgo.js b/src/components/SyncAgo.js new file mode 100644 index 00000000..320732cf --- /dev/null +++ b/src/components/SyncAgo.js @@ -0,0 +1,16 @@ +// @flow + +import React, { PureComponent } from 'react' +import moment from 'moment' +import { translate } from 'react-i18next' +import type { T } from 'types/common' +import Box from './base/Box' + +class SyncAgo extends PureComponent<{ t: T, date: Date }> { + render() { + const { t, date } = this.props + return {t('app:common.sync.ago', { time: moment(date).fromNow() })} + } +} + +export default translate()(SyncAgo) diff --git a/src/components/modals/AccountSettingRenderBody.js b/src/components/modals/AccountSettingRenderBody.js index ee8594e8..c4aef19d 100644 --- a/src/components/modals/AccountSettingRenderBody.js +++ b/src/components/modals/AccountSettingRenderBody.js @@ -22,6 +22,7 @@ import Box from 'components/base/Box' import Button from 'components/base/Button' import Input from 'components/base/Input' import Select from 'components/base/Select' +import SyncAgo from 'components/SyncAgo' import { ModalBody, @@ -258,12 +259,12 @@ class HelperComp extends PureComponent { ) : null} +