Skip to content

Commit

Permalink
Merge pull request #7 from MyriadFlow/ui
Browse files Browse the repository at this point in the history
notification position changed
  • Loading branch information
devsisingh committed Jun 29, 2024
2 parents 6181e5b + 8d96193 commit d97098a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
28 changes: 21 additions & 7 deletions src/app/create-brand/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ function getNumber() public view returns (uint256) {

async function onSubmit(values: z.infer<typeof formSchema>) {
if (!account.addresses) {
toast.warning('Connect your wallet')
toast.warning('Connect your wallet', {
position: 'top-left',
})
} else {
if (!imageUrl) {
setImageError(true)
Expand Down Expand Up @@ -288,15 +290,21 @@ function getNumber() public view returns (uint256) {
console.log(brand)
localStorage.setItem("BrandId", brand.id);
if (response.status === 200) {
toast.warning('Now we are deploying AccessMaster to manage out brand')
toast.warning('Now we are deploying AccessMaster to manage out brand', {
position: 'top-left',
})
const deploySuccess = await handleDeploy();
if (deploySuccess) {
// const verifySuccess = await handleVerify();
// if (verifySuccess) {
toast.warning('Now we will deploy TradeHub ')
toast.warning('Now we will deploy TradeHub ', {
position: 'top-left',
})
const deployTradeHub = await handleDeploy();
if(deployTradeHub){
toast.success('Deploy Successful')
toast.success('Deploy Successful', {
position: 'top-left',
})
const users = await fetch(`${apiUrl}/users`,
{
method: 'POST',
Expand All @@ -308,7 +316,9 @@ function getNumber() public view returns (uint256) {
}),
})
console.log(users);
toast.success('Your Brand has been created')
toast.success('Your Brand has been created', {
position: 'top-left',
})
router.push(`/congratulations?bramd_name=${values.name}`);
// }
}
Expand All @@ -319,11 +329,15 @@ function getNumber() public view returns (uint256) {
// }

} else if (!imageError && imageUrl === '') {
toast.warning('Wait for your image to finish upload')
toast.warning('Wait for your image to finish upload', {
position: 'top-left',
})
}
} catch (error) {
console.log(error)
toast.warning('Failed to create Brand')
toast.warning('Failed to create Brand', {
position: 'top-left',
})
setLoading(false)
}
}
Expand Down
16 changes: 12 additions & 4 deletions src/app/create-phygital-detail/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,26 @@ function getNumber() public view returns (uint256) {
}

if (phygitalResponse.status === 200) {
toast.warning('Now we are deploing phygital to launch your nft collection')
toast.warning('Now we are deploing phygital to launch your nft collection', {
position: 'top-left',
})
const deploySuccess = await handleDeploy();
if (deploySuccess) {
toast.success('Deploy Successful')
toast.success('Deploy Successful', {
position: 'top-left',
})
router.push('/create-avatar')
}
} else {
toast.warning('Failed to create phygital data')
toast.warning('Failed to create phygital data', {
position: 'top-left',
})
}
} catch (error) {
console.error(error)
toast.error('An error occurred while creating phygital data')
toast.error('An error occurred while creating phygital data', {
position: 'top-left',
})
} finally {
setLoading(false)
}
Expand Down

0 comments on commit d97098a

Please sign in to comment.