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

[HUM-159]: refactor component sign up component refactor #3157

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

mpblocky
Copy link
Contributor

@mpblocky mpblocky commented Mar 6, 2025

Issue tracking

HUM-159

Context behind the change

  • Moved code related to operator sign up to homepage/signup/operator

How has this been tested?

  • checked if its possible to sign up as new operator

Release plan

normal

Potential risks; What to monitor; Rollback plan

n/a

Copy link

vercel bot commented Mar 6, 2025

@mpblocky is attempting to deploy a commit to the HUMAN Protocol Team on Vercel.

A member of the Team first needs to authorize it.

@mpblocky mpblocky marked this pull request as ready for review March 6, 2025 10:33
@mpblocky
Copy link
Contributor Author

mpblocky commented Mar 6, 2025

@dnechay ready!

@dnechay dnechay self-requested a review March 6, 2025 10:40
Copy link

vercel bot commented Mar 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
human-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2025 0:25am

Copy link
Contributor

@dnechay dnechay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall
Some minor style comments

@@ -342,7 +342,7 @@
},
"connectWallet": {
"title": "Setup Operator",
"description": "Please use the button bellow to connect your wallet and sign up as an operator.",
"description": "Please use the button below to connect your wallet and sign up as an operator.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

keysData: GetEthKVStoreValuesSuccessResponse;
}>) {
const hasSomeNotEmptyKeys =
Object.values(keysData).filter(Boolean).length > 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Object.values(keysData).filter(Boolean).length > 0;
Object.values(keysData).some(Boolean);

Comment on lines +18 to +29
Object.values(keysData).filter((value) => {
/**
* This check is necessary because TS can't infer
* "undefined" from optional object's property
*/
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (value === undefined) {
return false;
}

return value.length === 0;
}).length > 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Object.values(keysData).filter((value) => {
/**
* This check is necessary because TS can't infer
* "undefined" from optional object's property
*/
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (value === undefined) {
return false;
}
return value.length === 0;
}).length > 0;
Object.values(keysData).some((value) => {
/**
* This check is necessary because TS can't infer
* "undefined" from optional object's property
*/
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (value === undefined) {
return false;
}
return value.length === 0;
});

useHMTokenDecimals,
} from '../hooks';
import { StakeForm, Buttons } from '../components/add-stake';
import { stakedAmountFormatter } from '../utils';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit below in getAlert, let's maybe do switch based on addStakeMutationState?.status instead of true?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also let's do something similar in ConnectWalletOperatorPage component


type AmountField = z.infer<AmountValidation>;

export const addStakeAmountCallArgumentsSchema = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema is not a util, it's actually a schema, so let's either move them to some signup/operator/schemas

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was a bit unsure about how we want to store that, will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants