Close #1748
Squashed commit of the following:
commit 16721edf69eb3f5ad96253e0999b99c3aaeac822
Merge: 15e1867f eac1b809
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Tue Jun 2 13:37:57 2020 +0300
Merge branch 'master' into fix/1748
commit 15e1867fdaee8d5c024d74ee2ef7416fec920341
Author: ArtemBaskal <a.baskal@adguard.com>
Date: Mon Jun 1 13:54:15 2020 +0300
- client: Hide version on inintial setup and login
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Trans, withTranslation } from 'react-i18next';
|
|
|
|
import './Version.css';
|
|
|
|
const Version = (props) => {
|
|
const {
|
|
dnsVersion, processingVersion, t, checkUpdateFlag,
|
|
} = props;
|
|
|
|
return (
|
|
<div className="version">
|
|
<div className="version__text">
|
|
{dnsVersion
|
|
&& <>
|
|
<Trans>version</Trans>:
|
|
<span className="version__value" title={dnsVersion}>{dnsVersion}</span>
|
|
</>}
|
|
{checkUpdateFlag && <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>}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
Version.propTypes = {
|
|
dnsVersion: PropTypes.string,
|
|
getVersion: PropTypes.func,
|
|
processingVersion: PropTypes.bool,
|
|
checkUpdateFlag: PropTypes.bool,
|
|
t: PropTypes.func.isRequired,
|
|
};
|
|
|
|
export default withTranslation()(Version);
|