-
Notifications
You must be signed in to change notification settings - Fork 22
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: change input of name TNS register #978
Conversation
✅ Deploy Preview for testitori ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for teritori-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't create a specific component, you just copy what they done in CreateDAOSection.tsx
but it's better to have an input component that check available names, that call the TextInputCustom
etc. and called this component in CreateDAOSection
and TNSNameFinderModal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean use TextInputCustom
in both file (CreateDAOSection
and TNSNameFinderModal
)?
and write logic in TextInputCustom
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, create a specific input components in packages/components/inputs
that called TextInputCustom
and write logic in it. And after that call this specific component in CreateDAOSection
and TNSNameFinderModal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with clemsss, please extract the component
7a79ccb
to
e5f7bd4
Compare
const selectedWallet = useSelectedWallet(); | ||
const [network] = parseUserId(selectedWallet?.userId); | ||
const networkId = network?.id; | ||
const cosmosNetwork = getCosmosNetwork(networkId); | ||
const normalizedTokenId = ( | ||
name + cosmosNetwork?.nameServiceTLD || "" | ||
).toLowerCase(); | ||
|
||
const tokenId = name + cosmosNetwork?.nameServiceTLD || ""; | ||
|
||
const { nsMintPrice: price } = useNSMintPrice(networkId, normalizedTokenId); | ||
const { nameAvailable, loading } = useNSMintAvailability(networkId, tokenId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all this should be inside the AvailableNamesInput
component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep you have to move the logic too in the component, if it's possible, but i think it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you moved the logic in the new component, please clean comments in the code
const selectedWallet = useSelectedWallet(); | ||
const [network] = parseUserId(selectedWallet?.userId); | ||
const networkId = network?.id; | ||
const cosmosNetwork = getCosmosNetwork(networkId); | ||
const normalizedTokenId = ( | ||
name + cosmosNetwork?.nameServiceTLD || "" | ||
).toLowerCase(); | ||
|
||
const tokenId = name + cosmosNetwork?.nameServiceTLD || ""; | ||
|
||
const { nsMintPrice: price } = useNSMintPrice(networkId, normalizedTokenId); | ||
const { nameAvailable, loading } = useNSMintAvailability(networkId, tokenId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep you have to move the logic too in the component, if it's possible, but i think it is
3fa18cc
to
f96d3a1
Compare
import { | ||
neutral33, | ||
neutral77, | ||
primaryColor, | ||
redDefault, | ||
// primaryColor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this comments
And please pass the CI, don't export |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
No description provided.