Skip to content

Commit e7dfa00

Browse files
committed
* Make use of dialogs for update requests instead of modals
* Retrieve current version automatically * Bumped version number * Minor dependency updates
1 parent e93adbf commit e7dfa00

File tree

17 files changed

+90
-107
lines changed

17 files changed

+90
-107
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deadhash",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Hash calculator",
55
"homepage": "./",
66
"private": true,

src/components/Topbar/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import MenuIcon from '@material-ui/icons/Menu';
99
import Menu from "@material-ui/core/Menu";
1010
import MenuItem from "@material-ui/core/MenuItem";
1111
import {useSelector, useDispatch} from "react-redux";
12-
import Drawerbar from "../Drawerbar";
1312
import CloseIcon from '@material-ui/icons/Close';
1413
import MinimizeIcon from "@material-ui/icons/Minimize";
1514
import FullScreenIcon from "@material-ui/icons/Fullscreen";
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React, {useState} from "react";
2+
import {useSelector} from "react-redux";
3+
import Dialog from '@material-ui/core/Dialog';
4+
import DialogActions from '@material-ui/core/DialogActions';
5+
import DialogContent from '@material-ui/core/DialogContent';
6+
import DialogContentText from '@material-ui/core/DialogContentText';
7+
import DialogTitle from '@material-ui/core/DialogTitle';
8+
import Button from "@material-ui/core/Button";
9+
10+
const UpdateDialog = ({downloadUrl, infoUrl, newVersion}) => {
11+
12+
const language = useSelector(state => state.MainReducer.languages[state.MainReducer.languageIndex]);
13+
const [open, setOpen] = useState(true);
14+
15+
/**
16+
* Close the UpdateDialog instance
17+
*/
18+
const handleClose = () => {
19+
setOpen(false);
20+
};
21+
22+
/**
23+
* Open the information page
24+
*/
25+
const openInformation = () => {
26+
window.open(infoUrl, '_blank');
27+
};
28+
29+
/**
30+
* Open the download page
31+
*/
32+
const openDownload = () => {
33+
window.open(downloadUrl, '_blank');
34+
handleClose();
35+
};
36+
37+
return (
38+
<Dialog
39+
open={open}
40+
onClose={handleClose}
41+
aria-labelledby="alert-dialog-title"
42+
aria-describedby="alert-dialog-description"
43+
>
44+
<DialogTitle id="alert-dialog-title">{language.updateAvailable}</DialogTitle>
45+
<DialogContent>
46+
<DialogContentText id="alert-dialog-description">
47+
{language.newVersion.replace("{x}", newVersion)}
48+
</DialogContentText>
49+
</DialogContent>
50+
<DialogActions>
51+
<Button onClick={handleClose}>
52+
{language.cancel}
53+
</Button>
54+
<Button onClick={() => openInformation()} color="primary">
55+
{language.information}
56+
</Button>
57+
<Button onClick={openDownload} color="primary" autoFocus>
58+
{language.download}
59+
</Button>
60+
</DialogActions>
61+
</Dialog>
62+
);
63+
};
64+
65+
export default UpdateDialog;

src/components/UpdateModal/index.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/languages/de_DE.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const de_DE = () => {
77
help: "Hilfe",
88
language: "Sprache",
99
aboutSubtitle: "Erfahren Sie mehr über DeadHash",
10-
aboutMessage: "DeadHash wurde von DeadLine erstellt.\n\nEinige Bilder wurden von icons8 bereitgestellt: https://icons8.com\nLizenz: GPLv3\nVersion: 2.0\n\nCopyright © 2020 CodeDead",
10+
aboutMessage: "DeadHash wurde von DeadLine erstellt.\n\nEinige Bilder wurden von icons8 bereitgestellt: https://icons8.com\nLizenz: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead",
1111
codedead: "CodeDead",
1212
theme: "Thema",
1313
general: "Allgemeines",

src/languages/en_US.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const en_US = () => {
77
help: "Help",
88
language: "Language",
99
aboutSubtitle: "Learn more about DeadHash",
10-
aboutMessage: "DeadHash was created by DeadLine.\n\nSome images were provided by icons8: https://icons8.com\nLicense: GPLv3\nVersion: 2.0\n\nCopyright © 2020 CodeDead",
10+
aboutMessage: "DeadHash was created by DeadLine.\n\nSome images were provided by icons8: https://icons8.com\nLicense: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead",
1111
codedead: "CodeDead",
1212
theme: "Theme",
1313
general: "General",

src/languages/fr_FR.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const fr_FR = () => {
77
help: "Aide",
88
language: "Langue",
99
aboutSubtitle: "En savoir plus sur DeadHash",
10-
aboutMessage: "DeadHash a été créé par DeadLine.\n\nCertaines images ont été fournies par icons8: https://icons8.com\nLicence: GPLv3\nVersion: 2.0\n\nCopyright © 2020 CodeDead",
10+
aboutMessage: "DeadHash a été créé par DeadLine.\n\nCertaines images ont été fournies par icons8: https://icons8.com\nLicence: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead",
1111
codedead: "CodeDead",
1212
theme: "Thème",
1313
general: "Général",

src/languages/it_IT.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const it_IT = () => {
77
help: "Aiuto",
88
language: "Linguaggio",
99
aboutSubtitle: "Ulteriori informazioni su DeadHash",
10-
aboutMessage: "DeadHash è stato creato da DeadLine.\n\nAlcune immagini sono state fornite da icons8: https://icons8.com\nLicenza: GPLv3\nVersione: 2.0\n\nCopyright © 2020 CodeDead",
10+
aboutMessage: "DeadHash è stato creato da DeadLine.\n\nAlcune immagini sono state fornite da icons8: https://icons8.com\nLicenza: GPLv3\nVersione: {x}\n\nCopyright © 2020 CodeDead",
1111
codedead: "CodeDead",
1212
theme: "Tema",
1313
general: "Generale",

src/languages/jp_JP.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const jp_JP = () => {
77
help: "助けて",
88
language: "言語",
99
aboutSubtitle: "DeadHashの詳細",
10-
aboutMessage: "DeadHashはDeadLineによって作成されました。\n\n一部の画像は、icons8によって提供されました:https://icons8.com\nライセンス:GPLv3\nバージョン:2.0\n\n著作権©2020 CodeDead",
10+
aboutMessage: "DeadHashはDeadLineによって作成されました。\n\n一部の画像は、icons8によって提供されました:https://icons8.com\nライセンス:GPLv3\nバージョン:{x}\n\n著作権©2020 CodeDead",
1111
codedead: "CodeDead",
1212
theme: "テーマ",
1313
general: "全般",

src/languages/nl_NL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const nl_NL = () => {
77
help: "Help",
88
language: "Taal",
99
aboutSubtitle: "Leer meer over DeadHash",
10-
aboutMessage: "DeadHash werd gemaakt door DeadLine.\n\nSommige afbeeldingen werden afgeleverd door icons8: https://icons8.com\nLicentie: GPLv3\nVersie: 2.0\n\nCopyright © 2020 CodeDead",
10+
aboutMessage: "DeadHash werd gemaakt door DeadLine.\n\nSommige afbeeldingen werden afgeleverd door icons8: https://icons8.com\nLicentie: GPLv3\nVersie: {x}\n\nCopyright © 2020 CodeDead",
1111
codedead: "CodeDead",
1212
theme: "Thema",
1313
general: "Algemeen",
@@ -59,7 +59,7 @@ const nl_NL = () => {
5959
reset: "Reset",
6060
updateAvailable: "Update beschikbaar!",
6161
information: "Informatie",
62-
newVersion: "Versie {x} is nu beschikbaar. Wil je deze nu downloaden?",
62+
newVersion: "Versie {x} is nu beschikbaar. Wil je deze versie nu downloaden?",
6363
checkForUpdates: "Controleer op updates",
6464
noUpdatesTitle: "Geen updates beschikbaar!",
6565
noUpdatesMessage: "Je gebruikt de laatste versie van DeadHash.",

0 commit comments

Comments
 (0)