-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: success state for registration
- Loading branch information
Showing
10 changed files
with
101 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'web': minor | ||
--- | ||
|
||
Dots now includes a "registration" page, where you can easily register a name on any namespace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@bns-x/api': patch | ||
--- | ||
|
||
Includes explicit types for `getNameDetails` TRPC endpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { currentUserAddressNameStringsState } from '@store/names'; | ||
import { useAtomValue } from 'jotai'; | ||
import { Button } from '@components/ui/button'; | ||
import { useSwitchAccounts } from '@common/hooks/use-switch-accounts'; | ||
import { Link } from '@components/link'; | ||
|
||
export const RegisterNoName: React.FC<{ children?: React.ReactNode }> = () => { | ||
const { switchAccounts } = useSwitchAccounts(); | ||
const allNames = useAtomValue(currentUserAddressNameStringsState); | ||
const v1Name = allNames.coreName; | ||
return ( | ||
<div className="space-y-5 text-center"> | ||
<div className="flex flex-col gap-10 items-center"> | ||
<div> | ||
<h1 className="text-gray-200 text-7xl font-open-sauce-one font-medium tracking-normal leading-10 max-w-lg"> | ||
Register your BNS name | ||
</h1> | ||
</div> | ||
<p className="text-gray-200 text-sm font-inter font-normal tracking-normal leading-6 max-w-lg"> | ||
Looks like you registered {v1Name} for this account. Switch to an account that | ||
doesn't own any names, or <Link href="/upgrade">migrate your name to BNSx</Link>. | ||
</p> | ||
<Button className="w-60 text-md" size="lg" onClick={() => switchAccounts()}> | ||
Switch accounts | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { useMemo } from 'react'; | ||
import { useAtomValue } from 'jotai'; | ||
import { nameBeingRegisteredAtom, registerTxIdAtom, registrationTxAtom } from '@store/register'; | ||
import { Text } from '@components/text'; | ||
import { CenterBox } from '@components/layout'; | ||
import { DoneRow, PendingRow } from '@components/upgrade/rows'; | ||
|
||
export const RegistrationTx: React.FC<{ children?: React.ReactNode }> = () => { | ||
const registrationTx = useAtomValue(registrationTxAtom); | ||
const name = useAtomValue(nameBeingRegisteredAtom); | ||
const pending = useMemo(() => { | ||
if (typeof registrationTx?.tx_status === 'undefined') return true; | ||
if (registrationTx.tx_status === 'pending') return true; | ||
return false; | ||
}, [registrationTx?.tx_status]); | ||
|
||
if (registrationTx === null) return null; | ||
return ( | ||
<div className="flex items-center w-full flex-col"> | ||
<CenterBox mt="20px" mb="30px"> | ||
{pending ? ( | ||
<PendingRow txidAtom={registerTxIdAtom}>Registering {name}</PendingRow> | ||
) : ( | ||
<DoneRow txidAtom={registerTxIdAtom}>Registered {name}</DoneRow> | ||
)} | ||
</CenterBox> | ||
</div> | ||
); | ||
}; |