Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : updated congratulations page and fixed chaintype for both elev… #19

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/choose-down-arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 42 additions & 12 deletions src/app/congratulations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,58 @@
import { useSearchParams } from 'next/navigation'
import { Button, Navbar } from '@/components'
import Link from 'next/link'
import { Suspense } from 'react'
import { Suspense, useState } from 'react'

export default function Congratulations() {

const brand_name = localStorage.getItem('brand_name')

const [selectedOption, setSelectedOption] = useState<string>('');

const handleSelectChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
setSelectedOption(event.target.value);
};

return (
<Suspense>
<Navbar />
<main className='h-screen py-12 px-16 flex flex-col gap-8 text-black'>
<h1 className='text-3xl font-bold'>Congratulations</h1>
<p>Your brand {brand_name} has been launched successfully.</p>
{/* <Link href='/create-phygital'>
<Button className='w-fit bg-[#30D8FF] hover:text-white rounded-full text-black text-2xl'>
Create phygital
</Button>
</Link> */}
<Link href='/create-collection'>
<Button className='w-fit bg-[#30D8FF] hover:text-white rounded-full text-black text-2xl'>
Create Collection
</Button>
</Link>
<p className='text-xl'>Your brand {brand_name} has been launched successfully. <br />You are now ready to launch NFTs.</p>
<h1 className='text-4xl font-medium'>What would you like to create?</h1>
<div>
<select
style={{
backgroundImage: "url('/choose-down-arrow.png')",
backgroundRepeat: "no-repeat",
backgroundPosition: "right 1rem center",
backgroundSize: "16px 16px",
appearance: "none",
paddingRight: "2rem"
}}
className="bg-white rounded w-3/12 h-10 mt-8 border border-black px-4 font-semibold"
onChange={handleSelectChange}
value={selectedOption}
>
<option value="">+ Choose</option>
<option value="rare">Rare item (ERC-721)</option>
<option value="limited">Limited Edition (ERC-721A)</option>
</select>
{selectedOption === 'rare' ? (
<Link href="/create-collection">
<Button className="w-fit bg-[#30D8FF] hover:text-white rounded-full text-black text-2xl ml-20">
Continue
</Button>
</Link>
) : (
<Button
className="w-fit bg-[#30D8FF] hover:text-white rounded-full text-black text-2xl ml-20"
disabled={selectedOption !== 'rare'}
>
Continue
</Button>
)}
</div>
</main>
</Suspense>
)
Expand Down
33 changes: 32 additions & 1 deletion src/app/create-brand/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ const formSchema = z.object({
export default function CreateBrand() {
const { address: walletAddress } = useAccount()

useEffect(() => {
if (walletAddress) {
localStorage.setItem('walletAddress', walletAddress)
localStorage.setItem(
'BaseSepoliaChain',
'554b4903-9a06-4031-98f4-48276c427f78'
// '6c736e9b-37e6-43f5-9841-c0ac740282df'
)}
}, [walletAddress])

const [showForm, setShowForm] = useState(false)
const handleCheckboxChange = () => {
setShowForm(!showForm);
Expand All @@ -100,6 +110,19 @@ export default function CreateBrand() {
return
} else {
localStorage.setItem("elevateRegion", elevateRegion)
if(elevateRegion === 'Africa'){
localStorage.setItem(
'BaseSepoliaChain',
// '554b4903-9a06-4031-98f4-48276c427f78'
'6c736e9b-37e6-43f5-9841-c0ac740282df'
)
}else(
localStorage.setItem(
'BaseSepoliaChain',
'554b4903-9a06-4031-98f4-48276c427f78'
// '6c736e9b-37e6-43f5-9841-c0ac740282df'
)
)
}
}

Expand Down Expand Up @@ -779,7 +802,15 @@ export default function CreateBrand() {
<FormItem>
<FormControl>
<select
className='border-0 bg-[#0000001A] rounded w-full h-10 mt-8'
style={{
backgroundImage: "url('/choose-down-arrow.png')",
backgroundRepeat: "no-repeat",
backgroundPosition: "right 1rem center",
backgroundSize: "16px 16px",
appearance: "none",
paddingRight: "2rem"
}}
className="bg-white rounded w-full h-10 mt-8 border border-black px-4 font-semibold"
{...field}
>
<option value=''>+ Choose</option>
Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export default function Home() {
localStorage.setItem('walletAddress', walletAddress)
localStorage.setItem(
'BaseSepoliaChain',
// '554b4903-9a06-4031-98f4-48276c427f78'
'6c736e9b-37e6-43f5-9841-c0ac740282df'
'554b4903-9a06-4031-98f4-48276c427f78'
// '6c736e9b-37e6-43f5-9841-c0ac740282df'
)
setHasAddress(true)
getBrands()
Expand Down
Loading