Navigate to success page after auction creation

This commit is contained in:
IshaVenikar 2024-10-08 13:56:09 +05:30 committed by Nabarun
parent ee2c8d098a
commit 8ae1aec468
5 changed files with 36 additions and 23 deletions

View File

@ -30,7 +30,8 @@
[registryConfig]
fetchDeploymentRecordDelay = 5000
checkAuctionStatusDelay = 5000
restEndpoint = "http://dss-daemon.test1.wireitin.com:26657"
restEndpoint = "http://localhost:1317"
gqlEndpoint = "http://localhost:9473/api"
chainId = "laconic_9000-1"
privateKey = ""
bondId = ""

View File

@ -266,7 +266,7 @@ export class Service {
}
/**
* Checks for auction status for all ongoing auctions
* Checks the status for all ongoing auctions
* Calls the createDeploymentFromAuction method for deployments with completed auctions
*/
async checkAuctionStatus(): Promise<void> {

View File

@ -74,7 +74,15 @@ const Configure = () => {
auctionData
);
navigate(`/${orgSlug}/projects/create/template/deploy?projectId=${addProjectFromTemplate.id}&templateId=${templateId}`);
data.option === 'Auction'
? navigate(
`/${orgSlug}/projects/create/success/${addProjectFromTemplate.id}`,
{
state: {
isAuction: true
}
})
: navigate(`/${orgSlug}/projects/create/template/deploy?projectId=${addProjectFromTemplate.id}&templateId=${templateId}`);
} catch (error) {
console.error('Error creating project:', error);
toast({

View File

@ -1,4 +1,4 @@
import { Link, useParams } from 'react-router-dom';
import { Link, useLocation, useParams } from 'react-router-dom';
import Lottie from 'lottie-react';
import { Badge } from 'components/shared/Badge';
@ -19,6 +19,8 @@ const Id = () => {
const { id, orgSlug } = useParams();
const client = useGQLClient();
const [project, setProject] = useState<Project | null>(null);
const location = useLocation();
const { isAuction } = location.state || {};
const handleSetupDomain = async () => {
if (id) {
@ -51,22 +53,24 @@ const Id = () => {
{/* Heading */}
<div className="flex flex-col items-center gap-1.5">
<Heading as="h3" className="font-medium text-xl">
Project deployed successfully.
{isAuction? 'Project created successfully.' : 'Project deployed successfully.'}
</Heading>
<p className="flex flex-col items-center lg:flex-row font-sans gap-0.5 lg:gap-2 text-sm text-elements-high-em">
Your project has been deployed at{' '}
<Button
className="no-underline text-elements-link"
// TODO: use dynamic value
href={project ? `https://${project.subDomain}` : ''}
as="a"
variant="link-emphasized"
external
leftIcon={<LinkChainIcon />}
>
{project.subDomain}
</Button>
</p>
{!isAuction && (
<p className="flex flex-col items-center lg:flex-row font-sans gap-0.5 lg:gap-2 text-sm text-elements-high-em">
Your project has been deployed at{' '}
<Button
className="no-underline text-elements-link"
// TODO: use dynamic value
href={project ? `https://${project.subDomain}` : ''}
as="a"
variant="link-emphasized"
external
leftIcon={<LinkChainIcon />}
>
{project.subDomain}
</Button>
</p>
)}
</div>
{/* Card */}

View File

@ -1431,10 +1431,10 @@
resolved "https://registry.yarnpkg.com/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz#22abdcd83e008c369902976730c34c150148a758"
integrity sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==
"@cerc-io/registry-sdk@^0.2.5":
version "0.2.10"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.10/registry-sdk-0.2.10.tgz#15773ea36a862585cdcb0991cbf075736f845f96"
integrity sha512-xxVD7ylrN951TFoSFbluz7mt4SwSCv7z+yry3jGd8v8TWnycoBMMrrYSTfETs6Ydxwziiz/uLrRwk59vFZxLEA==
"@cerc-io/registry-sdk@^0.2.11":
version "0.2.11"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.11/registry-sdk-0.2.11.tgz#019b792c68f440f2cfca5af2f49e1205bb33ba72"
integrity sha512-IipqJzaBQEXMNH6yWFG2E/o0U6IAXw35PBMHx6QIboVu/sMNLIsWy1P8MmR8C8xYsmHOhgXLsC4hYSeFMXrqFw==
dependencies:
"@cosmjs/amino" "^0.28.1"
"@cosmjs/crypto" "^0.28.1"