Skip to content

Commit

Permalink
Add UI block to discovery login
Browse files Browse the repository at this point in the history
  • Loading branch information
huyndo committed Nov 3, 2022
1 parent dc3a2ab commit 8c6bd0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ export default function Home() {
const renderCommand = d => {
return (
<li key={d.LABEL}>
<button onClick={() => clickHandler(d)}>{d.LABEL}</button>
<button onClick={() => clickHandler(d.CMD)}>{d.LABEL}</button>
</li>
)
}

async function clickHandler(d) {
async function clickHandler(fn, args = null) {
setIsLoading(true)
await d.CMD()
await fn(args)
setIsLoading(false)
}

Expand Down Expand Up @@ -83,7 +83,7 @@ export default function Home() {
width={25}
height={25}
/>
<button onClick={() => fcl.authenticate({ service })}>
<button onClick={() => clickHandler(fcl.authenticate, { service })}>
Login with {service.provider.name}
</button>
</span>
Expand Down

0 comments on commit 8c6bd0d

Please sign in to comment.