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

Add success state to OperatorAddressMappingCard #261

Merged
merged 9 commits into from
Oct 26, 2022

Conversation

michalsmiarowski
Copy link
Contributor

@michalsmiarowski michalsmiarowski commented Oct 5, 2022

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.

image

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

We now want to display the `OperatorAddressMappingCard` when the operator is
successfully mapped to staking provider. We display the pair in the card.
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

<AlertIcon h={"14px"} as={"div"} alignSelf="auto" />
<BodyXs>
{isOneOfTheAppsNotMapped
? "One application from the tBTC + Random Beacon Rewards Bundle Suite requires the Operator Address mapped."
Copy link
Contributor

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?

@georgeweiler
Copy link
Contributor

@michalsmiarowski It looks like the designs have been re-updated. Do you want to implement the newest changnes here before we merge?

@michalsmiarowski
Copy link
Contributor Author

@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

@michalsmiarowski michalsmiarowski marked this pull request as draft October 6, 2022 15:09
@github-actions
Copy link

@github-actions
Copy link

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
@github-actions
Copy link

@github-actions
Copy link

@michalsmiarowski michalsmiarowski marked this pull request as ready for review October 17, 2022 12:53
@michalsmiarowski
Copy link
Contributor Author

@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.

@pdyraga pdyraga added this to the v1.3.1 milestone Oct 17, 2022
Base automatically changed from operator-mapping-code-cleaning to main October 24, 2022 09:13
@github-actions
Copy link

Copy link
Collaborator

@r-czajkowski r-czajkowski left a 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 👍

Comment on lines 38 to 41
const appLabels: AppLabels = {
tbtc: "tBTC",
randomBeacon: "Random Beacon",
}
Copy link
Collaborator

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.

Copy link
Contributor Author

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}`}>
Copy link
Collaborator

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 />}

@github-actions
Copy link

@r-czajkowski r-czajkowski merged commit 75197a8 into main Oct 26, 2022
@r-czajkowski r-czajkowski deleted the operator-mapping-card-success-state branch October 26, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Operator Mapping Card when operator is mapped
4 participants