Skip to content

Commit 6ae060d

Browse files
authored
Merge pull request #11 from CodeDead/feature/updates
Feature/updates
2 parents e93adbf + aac9b79 commit 6ae060d

File tree

19 files changed

+139
-166
lines changed

19 files changed

+139
-166
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,
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import React, {useState} from "react";
2+
import DialogTitle from "@material-ui/core/DialogTitle";
3+
import DialogContent from "@material-ui/core/DialogContent";
4+
import DialogContentText from "@material-ui/core/DialogContentText";
5+
import DialogActions from "@material-ui/core/DialogActions";
6+
import Button from "@material-ui/core/Button";
7+
import Dialog from "@material-ui/core/Dialog";
8+
import {useSelector} from "react-redux";
9+
10+
const AlertDialog = ({title, content}) => {
11+
12+
const language = useSelector(state => state.MainReducer.languages[state.MainReducer.languageIndex]);
13+
const [open, setOpen] = useState(true);
14+
15+
/**
16+
* Close the AlertDialog instance
17+
*/
18+
const handleClose = () => {
19+
setOpen(false);
20+
};
21+
22+
return (
23+
<Dialog
24+
open={open}
25+
onClose={handleClose}
26+
aria-labelledby="alert-dialog-title"
27+
aria-describedby="alert-dialog-description"
28+
>
29+
<DialogTitle id="alert-dialog-title">{title}</DialogTitle>
30+
<DialogContent>
31+
<DialogContentText id="alert-dialog-description">
32+
{content}
33+
</DialogContentText>
34+
</DialogContent>
35+
<DialogActions>
36+
<Button onClick={handleClose} color="primary" autoFocus>
37+
{language.ok}
38+
</Button>
39+
</DialogActions>
40+
</Dialog>
41+
);
42+
};
43+
44+
export default AlertDialog;

src/components/AlertModal/index.js

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

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",

0 commit comments

Comments
 (0)