badguardhome/client/src/components/ui/Version.js

40 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-08-30 14:25:33 +00:00
import React from 'react';
import PropTypes from 'prop-types';
2018-10-29 03:26:19 +00:00
import { Trans, withNamespaces } from 'react-i18next';
2018-08-30 14:25:33 +00:00
2019-09-05 16:07:14 +00:00
import './Version.css';
2019-06-25 14:56:50 +00:00
const Version = (props) => {
const {
2019-09-05 16:07:14 +00:00
dnsVersion, processingVersion, t,
2019-06-25 14:56:50 +00:00
} = props;
2018-08-30 14:25:33 +00:00
return (
2019-09-05 16:07:14 +00:00
<div className="version">
<div className="version__text">
<Trans>version</Trans>:&nbsp;<span className="version__value" title={dnsVersion}>{dnsVersion}</span>
2019-06-25 14:56:50 +00:00
<button
type="button"
className="btn btn-icon btn-icon-sm btn-outline-primary btn-sm ml-2"
onClick={() => props.getVersion(true)}
disabled={processingVersion}
title={t('check_updates_now')}
>
<svg className="icons">
<use xlinkHref="#refresh" />
</svg>
</button>
2018-09-21 12:20:41 +00:00
</div>
2018-08-30 14:25:33 +00:00
</div>
);
2019-06-25 14:56:50 +00:00
};
2018-08-30 14:25:33 +00:00
Version.propTypes = {
dnsVersion: PropTypes.string.isRequired,
2019-06-25 14:56:50 +00:00
getVersion: PropTypes.func.isRequired,
processingVersion: PropTypes.bool.isRequired,
t: PropTypes.func.isRequired,
2018-08-30 14:25:33 +00:00
};
2018-10-29 03:26:19 +00:00
export default withNamespaces()(Version);