Skip to content

Commit a04df05

Browse files
authored
Merge pull request #32 from CodeDead/release/2.1.0
Release/2.1.0
2 parents 0985cae + cf6a683 commit a04df05

File tree

29 files changed

+981
-581
lines changed

29 files changed

+981
-581
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
build
55
src/serviceWorker.js
66
README.md
7+
.eslintcache

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ dist/*
3333
!.yarn/sdks
3434
!.yarn/versions
3535
.pnp.*
36+
37+
.eslintcache

.yarn/releases/yarn-2.3.3.cjs

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

.yarn/releases/yarn-2.4.0.cjs

Lines changed: 55 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ nodeLinker: node-modules
22

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

7-
yarnPath: .yarn/releases/yarn-2.3.3.cjs
7+
yarnPath: .yarn/releases/yarn-2.4.0.cjs

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
![DeadHash](https://codedead.com/wp-content/uploads/2020/06/DeadHash.png)
1+
![DeadHash](https://i.imgur.com/PWrqQ67.png)
22

33
# DeadHash
44

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

99
DeadHash is a free and open-source utility to calculate file and text hashes. The following hash calculations are supported:
10+
1011
* MD4
1112
* MD5
1213
* SHA-1

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deadhash",
3-
"version": "2.0.4",
3+
"version": "2.1.0",
44
"description": "File and text hash calculator",
55
"homepage": "./",
66
"private": true,
@@ -12,7 +12,7 @@
1212
"build": {
1313
"appId": "com.codedead.deadhash",
1414
"productName": "DeadHash",
15-
"copyright": "Copyright © 2020 ${author}",
15+
"copyright": "Copyright © 2021 ${author}",
1616
"win": {
1717
"target": [
1818
"nsis",
@@ -35,16 +35,16 @@
3535
},
3636
"main": "public/electron.js",
3737
"dependencies": {
38-
"@material-ui/core": "^4.11.0",
39-
"@material-ui/icons": "^4.9.1",
40-
"cross-env": "^7.0.2",
38+
"@material-ui/core": "^4.11.3",
39+
"@material-ui/icons": "^4.11.2",
40+
"cross-env": "^7.0.3",
4141
"electron-is-dev": "^1.2.0",
4242
"react": "^17.0.1",
43-
"react-contexify": "^4.1.1",
43+
"react-contexify": "^5.0.0",
4444
"react-dom": "^17.0.1",
4545
"react-router": "^5.2.0",
4646
"react-router-dom": "^5.2.0",
47-
"react-scripts": "^4.0.0"
47+
"react-scripts": "^4.0.1"
4848
},
4949
"scripts": {
5050
"react-start": "react-scripts start",
@@ -70,13 +70,13 @@
7070
},
7171
"devDependencies": {
7272
"concurrently": "^5.3.0",
73-
"electron": "^10.1.5",
73+
"electron": "^11.2.1",
7474
"electron-builder": "^22.9.1",
7575
"eslint-config-airbnb": "^18.2.1",
7676
"eslint-plugin-import": "^2.22.1",
7777
"eslint-plugin-jsx-a11y": "^6.4.1",
78-
"eslint-plugin-react": "^7.21.5",
78+
"eslint-plugin-react": "^7.22.0",
7979
"eslint-plugin-react-hooks": "^4.2.0",
80-
"wait-on": "^5.2.0"
80+
"wait-on": "^5.2.1"
8181
}
8282
}

public/electron.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const createWindow = () => {
1515
mainWindow = new BrowserWindow({
1616
webPreferences: {
1717
nodeIntegration: true,
18+
contextIsolation: false,
1819
},
1920
frame: false,
2021
title: 'DeadHash',
@@ -26,13 +27,13 @@ const createWindow = () => {
2627
fileWorkerWindow = new BrowserWindow({
2728
show: isDev,
2829
icon: path.join(__dirname, '../build/logo512.png'),
29-
webPreferences: { nodeIntegration: true },
30+
webPreferences: { nodeIntegration: true, contextIsolation: false },
3031
});
3132

3233
textWorkerWindow = new BrowserWindow({
3334
show: isDev,
3435
icon: path.join(__dirname, '../build/logo512.png'),
35-
webPreferences: { nodeIntegration: true },
36+
webPreferences: { nodeIntegration: true, contextIsolation: false },
3637
});
3738

3839
if (isDev) {

src/components/App/index.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,14 @@ const App = () => {
2626
const [, dispatch] = useContext(CryptoContext);
2727

2828
const enabled = state.canDragDrop;
29-
let { themeIndex } = state;
30-
31-
let themeType = 'light';
32-
if (themeIndex === 8) {
33-
themeType = 'dark';
34-
themeIndex = 2;
35-
}
29+
const { themeIndex, themeStyle } = state;
3630

3731
const color = ThemeSelector(themeIndex);
3832

3933
const theme = createMuiTheme({
4034
palette: {
4135
primary: color,
42-
type: themeType,
36+
type: themeStyle,
4337
},
4438
});
4539

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
11
import React from 'react';
2-
import { Item, Menu, MenuProvider } from 'react-contexify';
2+
import { Item, Menu, useContextMenu } from 'react-contexify';
33
import CopyIcon from '@material-ui/icons/FileCopy';
44
import PasteIcon from '@material-ui/icons/Assignment';
55

66
const CopyPasteMenu = ({
77
id, children, copyData, pasteData, copy, paste,
8-
}) => (
9-
<>
10-
<MenuProvider id={`copyPasteMenu${id}`} style={{ width: '100%' }}>
11-
{children}
12-
</MenuProvider>
13-
<Menu id={`copyPasteMenu${id}`}>
14-
<Item onClick={() => copyData()}>
15-
<CopyIcon />
16-
{' '}
17-
{copy}
18-
</Item>
19-
<Item onClick={() => pasteData()}>
20-
<PasteIcon />
21-
{' '}
22-
{paste}
23-
</Item>
24-
</Menu>
25-
</>
26-
);
8+
}) => {
9+
const MENU_ID = `copyPasteMenu${id}`;
10+
11+
const { show } = useContextMenu({
12+
id: MENU_ID,
13+
});
14+
15+
/**
16+
* Handle the context menu event
17+
* @param event The event argument
18+
*/
19+
const handleContextMenu = (event) => {
20+
event.preventDefault();
21+
show(event, {
22+
props: {
23+
key: 'value',
24+
},
25+
});
26+
};
27+
28+
return (
29+
<>
30+
<div
31+
style={{ width: '100%' }}
32+
onContextMenu={handleContextMenu}
33+
>
34+
{children}
35+
</div>
36+
<Menu id={MENU_ID}>
37+
<Item onClick={() => copyData()}>
38+
<CopyIcon />
39+
{' '}
40+
{copy}
41+
</Item>
42+
<Item onClick={() => pasteData()}>
43+
<PasteIcon />
44+
{' '}
45+
{paste}
46+
</Item>
47+
</Menu>
48+
</>
49+
);
50+
};
2751

2852
export default CopyPasteMenu;

0 commit comments

Comments
 (0)