|
@@ -3,6 +3,7 @@ import { gitCommitPath } from 'lib/paths';
|
|
|
import { GIT_REPO_LATEST_RELEASE_LINK } from 'lib/constants';
|
|
|
import WarningIcon from 'components/common/Icons/WarningIcon';
|
|
|
|
|
|
+import * as S from './Version.styled';
|
|
|
import compareVersions from './compareVersions';
|
|
|
|
|
|
export interface VesionProps {
|
|
@@ -15,6 +16,7 @@ const Version: React.FC<VesionProps> = ({ tag, commit }) => {
|
|
|
outdated: false,
|
|
|
latestTag: '',
|
|
|
});
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
fetch(GIT_REPO_LATEST_RELEASE_LINK)
|
|
|
.then((response) => response.json())
|
|
@@ -29,30 +31,31 @@ const Version: React.FC<VesionProps> = ({ tag, commit }) => {
|
|
|
const { outdated, latestTag } = latestVersionInfo;
|
|
|
|
|
|
return (
|
|
|
- <div className="is-size-8 has-text-grey">
|
|
|
- <span className="has-text-grey-light mr-1">Version:</span>
|
|
|
- <span className="mr-1">{tag}</span>
|
|
|
+ <S.Wrapper>
|
|
|
+ <S.CurrentVersion>{tag}</S.CurrentVersion>
|
|
|
+
|
|
|
{outdated && (
|
|
|
- <span
|
|
|
+ <S.OutdatedWarning
|
|
|
title={`Your app version is outdated. Current latest version is ${latestTag}`}
|
|
|
>
|
|
|
<WarningIcon />
|
|
|
- </span>
|
|
|
+ </S.OutdatedWarning>
|
|
|
)}
|
|
|
+
|
|
|
{commit && (
|
|
|
<>
|
|
|
- <span>(</span>
|
|
|
- <a
|
|
|
+ <S.SymbolWrapper>(</S.SymbolWrapper>
|
|
|
+ <S.CurrentCommitLink
|
|
|
title="Current commit"
|
|
|
target="__blank"
|
|
|
href={gitCommitPath(commit)}
|
|
|
>
|
|
|
{commit}
|
|
|
- </a>
|
|
|
- <span>)</span>
|
|
|
+ </S.CurrentCommitLink>
|
|
|
+ <S.SymbolWrapper>)</S.SymbolWrapper>
|
|
|
</>
|
|
|
)}
|
|
|
- </div>
|
|
|
+ </S.Wrapper>
|
|
|
);
|
|
|
};
|
|
|
|