Skip to content

Commit bc12b7e

Browse files
committed
frontend: refactor send into a functional component
1 parent 63286f4 commit bc12b7e

File tree

5 files changed

+388
-416
lines changed

5 files changed

+388
-416
lines changed

frontends/web/src/api/account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export const sendTx = (
364364
return apiPost(`account/${code}/sendtx`, txNote);
365365
};
366366

367-
export type FeeTargetCode = 'custom' | 'low' | 'economy' | 'normal' | 'high';
367+
export type FeeTargetCode = 'custom' | 'low' | 'economy' | 'normal' | 'high' | 'mHour' | 'mHalfHour' | 'mFastest';
368368

369369
export interface IProposeTxData {
370370
address?: string;

frontends/web/src/routes/account/send/components/inputs/receiver-address-input.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
justify-content: center;
2727
padding: 0;
2828
position: absolute;
29-
top: calc(50% - var(--space-quarter));
29+
top: calc(50% - var(--space-eight));
3030
right: calc(var(--spacing-default) - var(--space-quarter));
3131
cursor: pointer;
3232
}

frontends/web/src/routes/account/send/feetargets.module.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ select.priority {
9191
.feeCustom input {
9292
padding-right: 58px;
9393
}
94+
.feeCustom input:disabled {
95+
padding-right: 66px;
96+
padding-top: 2px;
97+
}
9498

9599
.feeDescription,
96100
.feeProposed {
@@ -102,7 +106,12 @@ select.priority {
102106
}
103107

104108
.feeProposed {
105-
margin: 0;
109+
margin: 0 0 var(--space-quarter) 0;
110+
}
111+
@media (min-width: 769px) {
112+
.feeProposed {
113+
margin: 0;
114+
}
106115
}
107116

108117
.feeDescription + .feeProposed {

frontends/web/src/routes/account/send/feetargets.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright 2018 Shift Devices AG
3-
* Copyright 2021-2024 Shift Crypto AG
3+
* Copyright 2021-2025 Shift Crypto AG
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -91,13 +91,16 @@ export const FeeTargets = ({
9191
});
9292
}
9393
setOptions(options);
94+
if (feeTarget) {
95+
return;
96+
}
9497
setFeeTarget(feeTargets.defaultFeeTarget);
9598
onFeeTargetChange(feeTargets.defaultFeeTarget);
9699
if (feeTargets.feeTargets.length === 0) {
97100
setNoFeeTargets(true);
98101
}
99102
focusInput();
100-
}, [t, feeTargets, focusInput, accountCode, config, onFeeTargetChange, disabled]);
103+
}, [t, feeTarget, feeTargets, focusInput, accountCode, config, onFeeTargetChange, disabled]);
101104

102105
const handleFeeTargetChange = (event: React.SyntheticEvent) => {
103106
const target = event.target as HTMLSelectElement;

0 commit comments

Comments
 (0)