-
Notifications
You must be signed in to change notification settings - Fork 5
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: add keys option to the add shared wallet modal main page #1227
feat: add keys option to the add shared wallet modal main page #1227
Conversation
Allure Report
smokeTests: ✅ test report for 611bbdca
|
4d20a26
to
ff2bb90
Compare
StateConstantDataPart; | ||
|
||
export type StateSetup = MakeState<{ | ||
const makeState = defineStateShape<{ |
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 the changes in this file are unrelated to the main goal. Initially, I took a path of creating a dedicated store for the add modal main page so I created defineStateShape
util so it could be reused in both stores. Later on I dropped the new store, but since I found those changes beneficial, I decided to keep them. I hope you think the same. However it that is not the case I am happy to revert.
@@ -0,0 +1,23 @@ | |||
type StateObject = Record<string, unknown>; |
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.
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.
Great job, Szymon. I like how you make the most of TypeScript generics. Just left small suggestions.
...llets/src/add-shared-wallet/main-page-flow/SharedWalletGetStarted/SharedWalletGetStarted.tsx
Outdated
Show resolved
Hide resolved
...commonKeysOptionCopies, | ||
button: t('sharedWallets.addSharedWallet.getStarted.keysOption.button.copy'), | ||
}, | ||
keysCopyToastText: 'Shared keys copied to clipboard', |
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.
should this not be placed in the translations?
...llets/src/add-shared-wallet/main-page-flow/SharedWalletGetStarted/SharedWalletGetStarted.tsx
Outdated
Show resolved
Hide resolved
|
sharedKeys?: string; | ||
}; | ||
|
||
const makeCopyKeysToClipboard = (sharedKeys: string) => async () => { |
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.
Can be just copyKeysToClipboard
?
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 would prefer to stick to the make
prefix as it indicates the function produces the target thing 🙏
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.
Sorry maybe it's a bit too early in the day for me :D - why are we making a function for this and not directly invoking it in the component using it?
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.
It is a good question 😛 I guess it is a matter of taste. I could inline it, define it in the component body right before the return
, or do it the way I did it. I just find it cleaner this way 😉. But I am happy to move it to the component body. Would you like me to do it?
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.
Yes please.
<Flex flexDirection="column" p="$16" alignItems="center" justifyContent="space-between"> | ||
<Icon className={styles.icon} data-testid={`${testId}-icon`} /> | ||
<Flex flexDirection="column" p="$16" alignItems="center" justifyContent="space-between" className={styles.option}> | ||
<Icon className={cn(styles.icon, { [`${styles.disabled}`]: disabled })} data-testid={`${testId}-icon`} /> |
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.
<Icon className={cn(styles.icon, { [`${styles.disabled}`]: disabled })} data-testid={`${testId}-icon`} /> | |
<Icon className={cn(styles.icon, { [styles.disabled]: disabled })} data-testid={`${testId}-icon`} /> |
sx({ | ||
color: '$text_primary', | ||
}), | ||
{ [`${styles.disabled}`]: disabled }, |
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.
{ [`${styles.disabled}`]: disabled }, | |
{ [styles.disabled]: disabled }, |
<Text.Body.Small weight="$semibold" className={styles.description} data-testid={`${testId}-description`}> | ||
<Text.Body.Small | ||
weight="$semibold" | ||
className={cn(styles.description, { [`${styles.disabled}`]: disabled })} |
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.
className={cn(styles.description, { [`${styles.disabled}`]: disabled })} | |
className={cn(styles.description, { [styles.disabled]: disabled })} |
import { VFC } from 'react'; | ||
import { SharedWalletGetStarted, SharedWalletGetStartedSharedProps } from './SharedWalletGetStarted'; | ||
|
||
type AddSharedWalletMainPageFlowPrps = SharedWalletGetStartedSharedProps & { |
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.
type AddSharedWalletMainPageFlowPrps = SharedWalletGetStartedSharedProps & { | |
type AddSharedWalletMainPageFlowProps = SharedWalletGetStartedSharedProps & { |
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 small questions/suggestions.
Checklist
Proposed solution
Explain how does this PR solves the problem stated in JIRA ticket.
You can also enumerate different alternatives considered while approaching this task.
Testing
Describe here, how the new implementation can be tested.
Provide link or briefly describe User Acceptance Criteria/Tests that need to be met
Screenshots