Skip to content

Commit

Permalink
Merge pull request #32 from CodeDead/release/2.1.0
Browse files Browse the repository at this point in the history
Release/2.1.0
  • Loading branch information
CodeDead authored Feb 2, 2021
2 parents 0985cae + cf6a683 commit a04df05
Show file tree
Hide file tree
Showing 29 changed files with 981 additions and 581 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
build
src/serviceWorker.js
README.md
.eslintcache
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ dist/*
!.yarn/sdks
!.yarn/versions
.pnp.*

.eslintcache
55 changes: 0 additions & 55 deletions .yarn/releases/yarn-2.3.3.cjs

This file was deleted.

55 changes: 55 additions & 0 deletions .yarn/releases/yarn-2.4.0.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ nodeLinker: node-modules

plugins:
- path: .yarn/plugins/yarn-up-all-plugin.cjs
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.0.2/index.js"
spec: "https://github.com/e5mode/yarn-up-all/releases/download/1.0.3/index.js"

yarnPath: .yarn/releases/yarn-2.3.3.cjs
yarnPath: .yarn/releases/yarn-2.4.0.cjs
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
![DeadHash](https://codedead.com/wp-content/uploads/2020/06/DeadHash.png)
![DeadHash](https://i.imgur.com/PWrqQ67.png)

# DeadHash

![GitHub package.json version](https://img.shields.io/github/package-json/v/CodeDead/DeadHash-js)
![GitHub](https://img.shields.io/github/license/CodeDead/DeadHash-Js)
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.0.4/total)
![GitHub Releases (by Release)](https://img.shields.io/github/downloads/CodeDead/DeadHash-js/2.1.0/total)

DeadHash is a free and open-source utility to calculate file and text hashes. The following hash calculations are supported:

* MD4
* MD5
* SHA-1
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deadhash",
"version": "2.0.4",
"version": "2.1.0",
"description": "File and text hash calculator",
"homepage": "./",
"private": true,
Expand All @@ -12,7 +12,7 @@
"build": {
"appId": "com.codedead.deadhash",
"productName": "DeadHash",
"copyright": "Copyright © 2020 ${author}",
"copyright": "Copyright © 2021 ${author}",
"win": {
"target": [
"nsis",
Expand All @@ -35,16 +35,16 @@
},
"main": "public/electron.js",
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"cross-env": "^7.0.2",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"cross-env": "^7.0.3",
"electron-is-dev": "^1.2.0",
"react": "^17.0.1",
"react-contexify": "^4.1.1",
"react-contexify": "^5.0.0",
"react-dom": "^17.0.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.0"
"react-scripts": "^4.0.1"
},
"scripts": {
"react-start": "react-scripts start",
Expand All @@ -70,13 +70,13 @@
},
"devDependencies": {
"concurrently": "^5.3.0",
"electron": "^10.1.5",
"electron": "^11.2.1",
"electron-builder": "^22.9.1",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"wait-on": "^5.2.0"
"wait-on": "^5.2.1"
}
}
5 changes: 3 additions & 2 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const createWindow = () => {
mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
frame: false,
title: 'DeadHash',
Expand All @@ -26,13 +27,13 @@ const createWindow = () => {
fileWorkerWindow = new BrowserWindow({
show: isDev,
icon: path.join(__dirname, '../build/logo512.png'),
webPreferences: { nodeIntegration: true },
webPreferences: { nodeIntegration: true, contextIsolation: false },
});

textWorkerWindow = new BrowserWindow({
show: isDev,
icon: path.join(__dirname, '../build/logo512.png'),
webPreferences: { nodeIntegration: true },
webPreferences: { nodeIntegration: true, contextIsolation: false },
});

if (isDev) {
Expand Down
10 changes: 2 additions & 8 deletions src/components/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,14 @@ const App = () => {
const [, dispatch] = useContext(CryptoContext);

const enabled = state.canDragDrop;
let { themeIndex } = state;

let themeType = 'light';
if (themeIndex === 8) {
themeType = 'dark';
themeIndex = 2;
}
const { themeIndex, themeStyle } = state;

const color = ThemeSelector(themeIndex);

const theme = createMuiTheme({
palette: {
primary: color,
type: themeType,
type: themeStyle,
},
});

Expand Down
64 changes: 44 additions & 20 deletions src/components/CopyPasteMenu/index.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
import React from 'react';
import { Item, Menu, MenuProvider } from 'react-contexify';
import { Item, Menu, useContextMenu } from 'react-contexify';
import CopyIcon from '@material-ui/icons/FileCopy';
import PasteIcon from '@material-ui/icons/Assignment';

const CopyPasteMenu = ({
id, children, copyData, pasteData, copy, paste,
}) => (
<>
<MenuProvider id={`copyPasteMenu${id}`} style={{ width: '100%' }}>
{children}
</MenuProvider>
<Menu id={`copyPasteMenu${id}`}>
<Item onClick={() => copyData()}>
<CopyIcon />
{' '}
{copy}
</Item>
<Item onClick={() => pasteData()}>
<PasteIcon />
{' '}
{paste}
</Item>
</Menu>
</>
);
}) => {
const MENU_ID = `copyPasteMenu${id}`;

const { show } = useContextMenu({
id: MENU_ID,
});

/**
* Handle the context menu event
* @param event The event argument
*/
const handleContextMenu = (event) => {
event.preventDefault();
show(event, {
props: {
key: 'value',
},
});
};

return (
<>
<div
style={{ width: '100%' }}
onContextMenu={handleContextMenu}
>
{children}
</div>
<Menu id={MENU_ID}>
<Item onClick={() => copyData()}>
<CopyIcon />
{' '}
{copy}
</Item>
<Item onClick={() => pasteData()}>
<PasteIcon />
{' '}
{paste}
</Item>
</Menu>
</>
);
};

export default CopyPasteMenu;
24 changes: 21 additions & 3 deletions src/components/Hash/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Paper from '@material-ui/core/Paper';
import { makeStyles } from '@material-ui/core';
import Typography from '@material-ui/core/Typography';
import CheckIcon from '@material-ui/icons/Check';
import { Menu, Item, MenuProvider } from 'react-contexify';
import { Menu, Item, useContextMenu } from 'react-contexify';
import 'react-contexify/dist/ReactContexify.min.css';
import CopyIcon from '@material-ui/icons/FileCopy';

Expand All @@ -19,6 +19,7 @@ const useStyles = makeStyles((theme) => ({
const Hash = ({
hashType, content, compareString, id, copy,
}) => {
const MENU_ID = `hashMenu${id}`;
const classes = useStyles();

let compareColor = null;
Expand All @@ -28,15 +29,32 @@ const Hash = ({
compareColor = { color: 'green' };
}

const { show } = useContextMenu({
id: MENU_ID,
});

/**
* Handle the context menu event
* @param event The event argument
*/
const handleContextMenu = (event) => {
event.preventDefault();
show(event, {
props: {
key: 'value',
},
});
};

return (
<Paper className={classes.paper}>
<Typography variant="subtitle1" color="primary" gutterBottom>
{hashType}
{compareIcon}
</Typography>
<MenuProvider id={`hashMenu${id}`}>
<div onContextMenu={handleContextMenu}>
<span style={compareColor}>{content}</span>
</MenuProvider>
</div>
<Menu id={`hashMenu${id}`}>
<Item onClick={() => navigator.clipboard.writeText(content)}>
<CopyIcon />
Expand Down
2 changes: 2 additions & 0 deletions src/contexts/MainContextProvider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import ru_RU from '../../languages/ru_RU';
import tr_TR from '../../languages/tr_TR';

const languageIndex = localStorage.languageIndex ? parseFloat(localStorage.languageIndex) : 1;
const themeStyle = localStorage.themeStyle ? localStorage.themeStyle : 'light';
const themeIndex = localStorage.themeIndex ? parseFloat(localStorage.themeIndex) : 0;
const autoUpdate = localStorage.autoUpdate && localStorage.autoUpdate === 'true' ? true : !localStorage.autoUpdate;
const minimizeEnabled = localStorage.minimizeEnabled && localStorage.minimizeEnabled === 'true' ? true : !localStorage.minimizeEnabled;
Expand All @@ -45,6 +46,7 @@ const initState = {
],
drawerOpen: false,
selectedListItem: 0,
themeStyle,
themeIndex,
autoUpdate,
checkedForUpdates: false,
Expand Down
9 changes: 6 additions & 3 deletions src/languages/de_DE/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const de_DE = () => ({
help: 'Hilfe',
language: 'Sprache',
aboutSubtitle: 'Erfahren Sie mehr über DeadHash',
aboutMessage: 'DeadHash wurde von DeadLine erstellt.\n\nEinige Bilder wurden von icons8 bereitgestellt: https://icons8.com\nLizenz: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead',
aboutMessage: 'DeadHash wurde von DeadLine erstellt.\n\nEinige Bilder wurden von icons8 bereitgestellt: https://icons8.com\nLizenz: GPLv3\nVersion: {x}\n\nCopyright © 2021 CodeDead',
codedead: 'CodeDead',
theme: 'Thema',
general: 'Allgemeines',
Expand Down Expand Up @@ -68,15 +68,18 @@ const de_DE = () => ({
maximizeEnabled: 'Schaltfläche "Maximieren"',
languageEnabled: 'Schaltfläche "Sprache"',
exit: 'Schließen',
darkTheme: 'Dunkel',
darkThemeDescription: 'Schont die Augen.',
export: 'Export',
yourTextHere: 'Dein Text hier',
filePath: 'Dateipfad',
yes: 'Ja',
no: 'Nein',
confirmation: 'Bestätigung',
confirmResetSettings: 'Möchten Sie wirklich alle Einstellungen zurücksetzen?',
themeStyle: 'Themenstil',
light: 'Licht',
dark: 'Dunkel',
orange: 'Orange',
orangeThemeDescription: 'Lass uns Niederländisch werden.',
});

// eslint-disable-next-line camelcase
Expand Down
9 changes: 6 additions & 3 deletions src/languages/en_US/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const en_US = () => ({
help: 'Help',
language: 'Language',
aboutSubtitle: 'Learn more about DeadHash',
aboutMessage: 'DeadHash was created by DeadLine.\n\nSome images were provided by icons8: https://icons8.com\nLicense: GPLv3\nVersion: {x}\n\nCopyright © 2020 CodeDead',
aboutMessage: 'DeadHash was created by DeadLine.\n\nSome images were provided by icons8: https://icons8.com\nLicense: GPLv3\nVersion: {x}\n\nCopyright © 2021 CodeDead',
codedead: 'CodeDead',
theme: 'Theme',
general: 'General',
Expand Down Expand Up @@ -68,15 +68,18 @@ const en_US = () => ({
maximizeEnabled: 'Maximize button',
languageEnabled: 'Language button',
exit: 'Exit',
darkTheme: 'Dark',
darkThemeDescription: 'Easy on the eyes.',
export: 'Export',
yourTextHere: 'Your text here',
filePath: 'File path',
yes: 'Yes',
no: 'No',
confirmation: 'Confirmation',
confirmResetSettings: 'Are you sure you want to reset all settings?',
themeStyle: 'Theme style',
light: 'Light',
dark: 'Dark',
orange: 'Orange',
orangeThemeDescription: 'Let\'s get Dutch.',
});

// eslint-disable-next-line camelcase
Expand Down
9 changes: 6 additions & 3 deletions src/languages/es_ES/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const es_ES = () => ({
help: 'Ayuda',
language: 'Idioma',
aboutSubtitle: 'Obtenga más información sobre DeadHash',
aboutMessage: 'DeadHash fue creado por DeadLine.\n\nAlgunas imágenes fueron proporcionadas por icons8: https://icons8.com\nLicencia: GPLv3\nVersión: {x}\n\nCopyright © 2020 CodeDead',
aboutMessage: 'DeadHash fue creado por DeadLine.\n\nAlgunas imágenes fueron proporcionadas por icons8: https://icons8.com\nLicencia: GPLv3\nVersión: {x}\n\nCopyright © 2021 CodeDead',
codedead: 'CodeDead',
theme: 'Tema',
general: 'General',
Expand Down Expand Up @@ -68,15 +68,18 @@ const es_ES = () => ({
maximizeEnabled: 'Botón Maximizar',
languageEnabled: 'Botón de idioma',
exit: 'Salida',
darkTheme: 'Oscuro',
darkThemeDescription: 'Fácil para los ojos.',
export: 'Exportar',
yourTextHere: 'Tu texto aqui',
filePath: 'Ruta de archivo',
yes: 'Sí',
no: 'No',
confirmation: 'Confirmación',
confirmResetSettings: '¿Estás seguro de que quieres restablecer todos los ajustes?',
themeStyle: 'Estilo del tema',
light: 'Ligero',
dark: 'Oscuro',
orange: 'Naranja',
orangeThemeDescription: 'Vamos a holandeses.',
});

// eslint-disable-next-line camelcase
Expand Down
9 changes: 6 additions & 3 deletions src/languages/fr_FR/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const fr_FR = () => ({
help: 'Aide',
language: 'Langue',
aboutSubtitle: 'En savoir plus sur DeadHash',
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',
aboutMessage: 'DeadHash a été créé par DeadLine.\n\nCertaines images ont été fournies par icons8: https://icons8.com\nLicence: GPLv3\nVersion: {x}\n\nCopyright © 2021 CodeDead',
codedead: 'CodeDead',
theme: 'Thème',
general: 'Général',
Expand Down Expand Up @@ -68,15 +68,18 @@ const fr_FR = () => ({
maximizeEnabled: 'Bouton Agrandir',
languageEnabled: 'Bouton de langue',
exit: 'Fermer',
darkTheme: 'Foncé',
darkThemeDescription: 'Facile sur les yeux.',
export: 'Exporter',
yourTextHere: 'Votre texte ici',
filePath: 'Chemin du fichier',
yes: 'Oui',
no: 'Non',
confirmation: 'Confirmation',
confirmResetSettings: 'Voulez-vous vraiment réinitialiser tous les paramètres?',
themeStyle: 'Style de thème',
light: 'Clair',
dark: 'Foncé',
orange: 'Orange',
orangeThemeDescription: 'Il faut que ça Néerlandais.',
});

// eslint-disable-next-line camelcase
Expand Down
Loading

0 comments on commit a04df05

Please sign in to comment.