-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add success state to OperatorAddressMappingCard #261
Conversation
We now want to display the `OperatorAddressMappingCard` when the operator is successfully mapped to staking provider. We display the pair in the card.
<AlertIcon h={"14px"} as={"div"} alignSelf="auto" /> | ||
<BodyXs> | ||
{isOneOfTheAppsNotMapped | ||
? "One application from the tBTC + Random Beacon Rewards Bundle Suite requires the Operator Address mapped." |
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 know that this matches designs, but I think it might be more clear to tell the user which app needs to be mapped. wdyt? worth bringing up?
@michalsmiarowski It looks like the designs have been re-updated. Do you want to implement the newest changnes here before we merge? |
Yes. I'll update this PR so let's not merge it yet |
…ard-success-state
We wnat to display the success state of the OperatorMappingCard not when all of the apps are mapped but when tbtc and random beacon are mapped (not necessarily PRE). That's why we change the variable name: areAllAppsMappedSuccessfuly -> shoudlDisplaySuccessState
…ard-success-state
@r-czajkowski @georgeweiler This one is ready to be reviewed. I will address the info about PRE app in a separate PR, because it will require a lot of changes. |
…ard-success-state
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.
Left two minor comments. Overall looks good 👍
const appLabels: AppLabels = { | ||
tbtc: "tBTC", | ||
randomBeacon: "Random Beacon", | ||
} |
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.
Let's use a function from ea991e2.
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.
Fixed in d818bfa
{shoudlDisplaySuccessState ? ( | ||
Object.entries(mappedOperators).map(([appName, operator]) => { | ||
return ( | ||
<Box key={`mapped_operator_${appName}_${operator}`}> |
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 think we can get rid of the Box
component and use Hstack
directly. Also adding the divider
prop to the HStack
we can get rid of the logic for rendering the line divider, I mean this code snippet:
{Object.keys(mappedOperators)[
Object.keys(mappedOperators).length - 1
] !== appName && <LineDivider />}
Use `getSakingAppLabel` function in OperatorAddressMappingCard
Closes: #259
Depends on: #223
OperatorAddressMappingCard
should be displayed in staking page also for the providers that already mapped an operator. We will keep this card with staking provider <> operator pair displayed.There are also a tooltip for each to help user know which address is which.
Note: The OperatorAddressMappingCard with a success state should be displayed at the top on left column when staking provider doesnt own any stakes, and at the bottom of the left column if he owns some stakes.
TODO in the future:
Link to Figma: https://www.figma.com/file/Tx1lZc7us4SqCeAgbt1hBV/Threshold-Dapp?node-id=6179%3A147494