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

feat: add keys option to the add shared wallet modal main page #1227

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

szymonmaslowski
Copy link
Contributor

@szymonmaslowski szymonmaslowski commented Jun 18, 2024

Checklist

  • JIRA - <link>
  • Proper tests implemented
  • Screenshots added.

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

image
image
image

@szymonmaslowski szymonmaslowski self-assigned this Jun 18, 2024
Base automatically changed from feat/shared-wallets-package to main June 18, 2024 11:49
Copy link

github-actions bot commented Jun 18, 2024

Allure Report

allure-report-publisher generated test report!

smokeTests: ✅ test report for 611bbdca

passed failed skipped flaky total result
Total 33 0 0 0 33

@szymonmaslowski szymonmaslowski force-pushed the feat/LW-10709-keys-option-in-add-shared-wallet branch from 4d20a26 to ff2bb90 Compare June 18, 2024 12:27
@szymonmaslowski szymonmaslowski marked this pull request as ready for review June 18, 2024 12:28
@szymonmaslowski szymonmaslowski requested review from a team as code owners June 18, 2024 12:28
StateConstantDataPart;

export type StateSetup = MakeState<{
const makeState = defineStateShape<{
Copy link
Contributor Author

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>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@danielmain danielmain left a 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.

...commonKeysOptionCopies,
button: t('sharedWallets.addSharedWallet.getStarted.keysOption.button.copy'),
},
keysCopyToastText: 'Shared keys copied to clipboard',
Copy link
Contributor

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?

Copy link

sharedKeys?: string;
};

const makeCopyKeysToClipboard = (sharedKeys: string) => async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be just copyKeysToClipboard?

Copy link
Contributor Author

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 🙏

Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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`} />
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
<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 },
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
{ [`${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 })}
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
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 & {
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
type AddSharedWalletMainPageFlowPrps = SharedWalletGetStartedSharedProps & {
type AddSharedWalletMainPageFlowProps = SharedWalletGetStartedSharedProps & {

Copy link
Contributor

@shawnbusuttil shawnbusuttil left a 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.

@szymonmaslowski szymonmaslowski merged commit ab257bd into main Jun 20, 2024
15 checks passed
@szymonmaslowski szymonmaslowski deleted the feat/LW-10709-keys-option-in-add-shared-wallet branch June 20, 2024 13:40
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.

5 participants