Skip to content

Commit

Permalink
preparing for release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Drazail committed Jul 15, 2022
1 parent c86eaf6 commit 2b479d6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hash": "file:../",
"react-hash": "0.1.0",
"react-scripts": "5.0.1"
},
"scripts": {
Expand Down
34 changes: 26 additions & 8 deletions example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import InputLabel from "@mui/material/InputLabel";
import MenuItem from "@mui/material/MenuItem";
import FormControl from "@mui/material/FormControl";
import Select from "@mui/material/Select";
import TextField from '@mui/material/TextField';
import React,{ useState } from "react";
import TextField from "@mui/material/TextField";
import React, { useState } from "react";
function App() {
const [hashAlgorithm, setHashAlgorithm] = useState("");
const [hmacAlgorithm, setHmacAlgorithm] = useState("");

const {hashed: hashedMessage, setMessage: setHashMessage, setAlgo: setHashAlgo} = useHash();
const {hmaced: hmac, setMessage: setHmacMessage, setAlgo: setHmacAlgo, setSecret: setHmacSecret} = useHmac();
console.log(useHash());
const [hashedMessage, setHashAlgo, setHashMessage] = useHash();
const [hmac, setHmacAlgo, setHmacMessage, setHmacSecret] = useHmac();

const handleHashAlgorithmChange = (event) => {
setHashAlgorithm(event.target.value);
Expand Down Expand Up @@ -49,7 +49,13 @@ function App() {
})}
</Select>
</FormControl>
<TextField label="message" fullWidth variant="outlined" style={{ marginTop:20}} onChange={handleHashStringChange}/>
<TextField
label="message"
fullWidth
variant="outlined"
style={{ marginTop: 20 }}
onChange={handleHashStringChange}
/>
<p>{hashedMessage}</p>
</div>
<div style={{ padding: 20 }}>
Expand All @@ -65,8 +71,20 @@ function App() {
})}
</Select>
</FormControl>
<TextField label="message" fullWidth variant="outlined" style={{ marginTop:20}} onChange={handleHMacStringChange}/>
<TextField label="secret" fullWidth variant="outlined" style={{ marginTop:20}} onChange={handleHMacSecretChange}/>
<TextField
label="message"
fullWidth
variant="outlined"
style={{ marginTop: 20 }}
onChange={handleHMacStringChange}
/>
<TextField
label="secret"
fullWidth
variant="outlined"
style={{ marginTop: 20 }}
onChange={handleHMacSecretChange}
/>
<p>{hmac}</p>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7454,8 +7454,10 @@ react-error-overlay@^6.0.11:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.11.tgz#92835de5841c5cf08ba00ddd2d677b6d17ff9adb"
integrity sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==

"react-hash@file:..":
react-hash@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/react-hash/-/react-hash-0.1.0.tgz#c6fc7cedb89ad990d487366175e5958dd66b0305"
integrity sha512-NLE0A8KJE0ysaU/nTrMc1ItUlgG7hOzySVJerU4hyWsjwc59dyk4312m9dJ/hs5nkHjy5IKo9oyOCwKyF+/bmg==

react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1"
Expand Down

0 comments on commit 2b479d6

Please sign in to comment.