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

Disable register button if user is not logged in #143

Merged
merged 1 commit into from
Oct 5, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Modal, Skeleton, Space, Tag } from 'antd'
import clsx from 'clsx'
import { useEffect, useState } from 'react'
import { useIsMyAddress } from 'src/components/auth/MyAccountsContext'
import { useIsMyAddress, useMyAddress } from 'src/components/auth/MyAccountsContext'
import { SelectAccountInput } from 'src/components/common/inputs/SelectAccountInput'
import { useBalancesByNetwork } from 'src/components/donate/AmountInput'
import { useGetDecimalAndSymbol } from 'src/components/utils/useGetDecimalsAndSymbol'
Expand Down Expand Up @@ -177,6 +177,7 @@ const RegisterDomainButton = ({
loadingPrice,
}: BuyByDotButtonProps) => {
const sellerConfig = useSelectSellerConfig()
const myAddress = useMyAddress()
const { sellerChain } = sellerConfig || {}
const { processingDomains } = useManageDomainContext()
const price = useGetPrice(domainSellerKind, domainPrice)
Expand All @@ -190,7 +191,8 @@ const RegisterDomainButton = ({

const chainProps = isSub ? {} : { decimals: decimal, currency: symbol }

const disableRegisterButton = processingDomains[domainName] || loadingPrice || price === '0'
const disableRegisterButton =
processingDomains[domainName] || loadingPrice || price === '0' || !myAddress

const priceValue = withPrice && (
<div>{price ? <FormatBalance value={price} {...chainProps} /> : <>-</>}</div>
Expand Down
Loading