Skip to content

feat(import): next gen import keystore #351

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

Merged
merged 26 commits into from
Jul 30, 2025
Merged

feat(import): next gen import keystore #351

merged 26 commits into from
Jul 30, 2025

Conversation

frichards
Copy link
Contributor

@frichards frichards commented Jul 22, 2025

Description

Ticket: https://ava-labs.atlassian.net/browse/CP-11431

Changes

This is going to allow the user to import account using keystore files.

2 issues that we need to solve later in k2-alpine:
The toast styling is off.
Icon used for the "Upload" page uses MdFileUpload for now as a placeholder icon.

Testing

You will need a keystore file.
If you do not have one, please talk to Ibrahim. He was able to share his test keystore file for me.

Please try importing the keystore file.

Screenshots:

Screen.Recording.2025-07-23.at.14.49.21.mov

Checklist for the author

Tick each of them when done or if not applicable.

  • I've covered new/modified business logic with Jest test cases.
  • I've tested the changes myself before sending it to code review and QA.

@frichards frichards changed the title Cp 11431 keystore feat(import): next gen import keystore (WIP) Jul 22, 2025
@frichards frichards changed the title feat(import): next gen import keystore (WIP) feat(import): next gen import keystore Jul 23, 2025
@frichards frichards marked this pull request as ready for review July 23, 2025 21:24
meeh0w
meeh0w previously approved these changes Jul 29, 2025
Copy link
Member

@meeh0w meeh0w left a comment

Choose a reason for hiding this comment

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

meeh0w
meeh0w previously approved these changes Jul 29, 2025
Comment on lines 5 to 18
const Light = () => {
return <img src={LightImage} alt="File Image" width={44} height={51} />;
};

const Dark = () => {
return <img src={DarkImage} alt="File Image" width={44} height={51} />;
};

export const FileImage = () => {
const theme = useTheme();

const image = theme.palette.mode === 'light' ? <Light /> : <Dark />;

return image;

Choose a reason for hiding this comment

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

The file can be simplified even more:

Suggested change
const Light = () => {
return <img src={LightImage} alt="File Image" width={44} height={51} />;
};
const Dark = () => {
return <img src={DarkImage} alt="File Image" width={44} height={51} />;
};
export const FileImage = () => {
const theme = useTheme();
const image = theme.palette.mode === 'light' ? <Light /> : <Dark />;
return image;
export const FileImage = () => {
const theme = useTheme();
const image = theme.palette.mode === 'light' ? LightImage : DarkImage
return <img src={Image} alt="File Image" width={44} height={51} />;

This way you don't need to remember to sync width and height of multiple components

flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
columnGap: '11px',

Choose a reason for hiding this comment

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

Please use design system responsive values instead of the fixed ones

Suggested change
columnGap: '11px',
<Stack
sx={{
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
columnGap: theme => theme.spacing(1.25)
}}

Choose a reason for hiding this comment

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

also, for the container components (Box, Stack & Grid) there's no need to use sx prop, because they export most of css properties as own props.
The notation is more concise and impacts the memory less

<Stack
  direction="row"
  justifyContent='space-between"
  alignItems="center"
  columnGap={1.25}
>

@frichards frichards merged commit 5e302e8 into main Jul 30, 2025
6 of 7 checks passed
@frichards frichards deleted the CP-11431-keystore branch July 30, 2025 16:22
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.

3 participants