Skip to content

frontend: refactor send into a functional component #3439

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontends/web/src/api/account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021-2024 Shift Crypto AG
* Copyright 2021-2025 Shift Crypto AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -364,7 +364,7 @@ export const sendTx = (
return apiPost(`account/${code}/sendtx`, txNote);
};

export type FeeTargetCode = 'custom' | 'low' | 'economy' | 'normal' | 'high';
export type FeeTargetCode = 'custom' | 'low' | 'economy' | 'normal' | 'high' | 'mHour' | 'mHalfHour' | 'mFastest';

export interface IProposeTxData {
address?: string;
Expand Down
7 changes: 5 additions & 2 deletions frontends/web/src/routes/account/send/feetargets.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright 2018 Shift Devices AG
* Copyright 2021-2024 Shift Crypto AG
* Copyright 2021-2025 Shift Crypto AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -91,13 +91,16 @@ export const FeeTargets = ({
});
}
setOptions(options);
if (feeTarget) {
return;
}
setFeeTarget(feeTargets.defaultFeeTarget);
onFeeTargetChange(feeTargets.defaultFeeTarget);
if (feeTargets.feeTargets.length === 0) {
setNoFeeTargets(true);
}
focusInput();
}, [t, feeTargets, focusInput, accountCode, config, onFeeTargetChange, disabled]);
}, [t, feeTarget, feeTargets, focusInput, accountCode, config, onFeeTargetChange, disabled]);

const handleFeeTargetChange = (event: React.SyntheticEvent) => {
const target = event.target as HTMLSelectElement;
Expand Down
Loading