Skip to content

Commit

Permalink
refactor: remove redundant async
Browse files Browse the repository at this point in the history
  • Loading branch information
HJunyuan committed Jun 19, 2024
1 parent ce75d59 commit 28909f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
20 changes: 5 additions & 15 deletions src/views/diagnose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,33 @@ export const Diagnose: React.FunctionComponent = () => {
<div>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${version === "2.0" ? "selected" : "unselected"}`}
onClick={async () => {
setVersion("2.0");
}}
onClick={() => setVersion("2.0")}
>
v2.0
</button>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${version === "3.0" ? "selected" : "unselected"}`}
onClick={async () => {
setVersion("3.0");
}}
onClick={() => setVersion("3.0")}
>
v3.0
</button>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${version === "4.0" ? "selected" : "unselected"}`}
onClick={async () => {
setVersion("4.0");
}}
onClick={() => setVersion("4.0")}
>
v4.0
</button>
</div>
<div>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${kind === "wrapped" ? "selected" : "unselected"}`}
onClick={async () => {
setKind("wrapped");
}}
onClick={() => setKind("wrapped")}
>
Wrapped
</button>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${kind === "signed" ? "selected" : "unselected"}`}
onClick={async () => {
setKind("signed");
}}
onClick={() => setKind("signed")}
>
Signed
</button>
Expand Down
8 changes: 2 additions & 6 deletions src/views/verify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ export const Verify: React.FunctionComponent = () => {
<NetworkButton
key={chain.name}
isNetworkSelected={chain.name === network}
onNetworkClick={async () => {
setNetwork(chain.name);
}}
onNetworkClick={() => setNetwork(chain.name)}
>
{chain.label}
</NetworkButton>
Expand All @@ -104,9 +102,7 @@ export const Verify: React.FunctionComponent = () => {
<NetworkButton
key={chain.name}
isNetworkSelected={chain.name === network}
onNetworkClick={async () => {
setNetwork(chain.name);
}}
onNetworkClick={() => setNetwork(chain.name)}
>
{chain.label}
</NetworkButton>
Expand Down
12 changes: 3 additions & 9 deletions src/views/wrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,19 @@ export const Wrap: React.FunctionComponent = () => {
<h1 className="text-3xl mb-4">(Un)Wrap an OpenAttestation document</h1>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${version === "2.0" ? "selected" : "unselected"}`}
onClick={async () => {
setVersion("2.0");
}}
onClick={() => setVersion("2.0")}
>
{"2.0"}
</button>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${version === "3.0" ? "selected" : "unselected"}`}
onClick={async () => {
setVersion("3.0");
}}
onClick={() => setVersion("3.0")}
>
{"3.0"}
</button>
<button
className={`btn-blue-small font-bold mb-2 mr-1 ${version === "4.0" ? "selected" : "unselected"}`}
onClick={async () => {
setVersion("4.0");
}}
onClick={() => setVersion("4.0")}
>
{"4.0"}
</button>
Expand Down

0 comments on commit 28909f1

Please sign in to comment.