Merge pull request #223 from MoltenCoffee/master

Update notice when new version is live
This commit is contained in:
Mike Cao 2020-09-28 22:17:36 -07:00 committed by GitHub
commit 9f9208ad18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,36 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import useVersion from '../../hooks/useVersion';
import Link from '../common/Link';
import styles from './UpdateNotice.module.css';
export default function UpdateNotice() {
const versions = useVersion();
console.log(versions);
if (!versions) return null;
const { current, latest } = versions;
return (
<div className={styles.wrapper}>
<div className={styles.heading}>
<FormattedMessage
id="message.new-version-available"
default="Version {latest} available! Current version: {current}"
values={{
latest: latest,
current: current,
}}
/>
</div>
<Link href="https://github.com/mikecao/umami" size="xsmall">
<div className={styles.message}>
<FormattedMessage
id="message.visit-github-update"
default="Click here to visit umami on github for instructions"
/>
</div>
</Link>
</div>
);
}

View file

@ -0,0 +1,15 @@
.wrapper {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
font-size: var(--font-size-xsmall);
}
.heading {
font-weight: 600;
margin: auto 10px;
}
.message,
.heading {
display: inline-block;
}