Skip to content

Commit

Permalink
Merge pull request #209 from greenlucid/master
Browse files Browse the repository at this point in the history
fix: loading info for add module
  • Loading branch information
auryn-macmillan authored Jun 2, 2023
2 parents a212613 + 25a3706 commit ded5262
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ const useStyles = makeStyles((theme) => ({
fill: `yellow !important`,
opacity: "100% !important",
},
addSpinner: {
color: `white !important`,
fill: `white !important`,
opacity: "100% !important",
},
detailsContainer: {
width: "95%",
},
Expand Down Expand Up @@ -258,6 +263,8 @@ export const KlerosRealityModuleModal = ({
// (emails.length > 0 || discordKey || (telegramBotToken && telegramChatId))))
emails.length > 0))

const [deploying, setDeploying] = useState<boolean>(false)

const validateEns = useCallback(async () => {
const address = await mainnetProvider.resolveName(params.snapshotEns)
console.log({ address })
Expand Down Expand Up @@ -372,6 +379,7 @@ export const KlerosRealityModuleModal = ({
}

const handleAddRealityModule = async () => {
setDeploying(true)
try {
const minimumBond = ethers.utils.parseUnits(params.bond, bondToken.decimals)
const args = {
Expand Down Expand Up @@ -446,6 +454,7 @@ export const KlerosRealityModuleModal = ({
} catch (error) {
console.log("Error deploying module: ", error)
}
setDeploying(false)
}

const handleBondChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -855,6 +864,7 @@ export const KlerosRealityModuleModal = ({
<Grid item xs={6}>
<ActionButton
fullWidth
disabled={deploying}
startIcon={<ArrowUpIcon style={{ rotate: "270deg" }} />}
onClick={() => setStep("form")}
>
Expand All @@ -864,14 +874,26 @@ export const KlerosRealityModuleModal = ({
<Grid item xs={6}>
<ActionButton
fullWidth
startIcon={<ArrowUpIcon />}
disabled={deploying}
startIcon={
deploying ? (
<Loader size="xs" className={classes.addSpinner} />
) : (
<ArrowUpIcon />
)
}
onClick={() => {
handleAddRealityModule()
}}
>
Add Module
</ActionButton>
</Grid>
{deploying && openMonitoring && (
<Grid xs={12} style={{ marginLeft: "8px" }}>
<div>This can take around a minute, please wait...</div>
</Grid>
)}
</Grid>
</>
)}
Expand Down

1 comment on commit ded5262

@vercel
Copy link

@vercel vercel bot commented on ded5262 Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zodiac-safe-app-ui – ./packages/app

zodiac-safe-app-ui-git-master-gnosis-guild.vercel.app
zodiac-safe-app-ui.vercel.app
zodiac-safe-app-ui-gnosis-guild.vercel.app

Please sign in to comment.