Skip to content

Commit cc2ceaa

Browse files
Add Custom Fee Rate for Withdrawal
Closes #36
1 parent 01058d8 commit cc2ceaa

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

apps/frontend/src/components/cln/BTCWithdraw/BTCWithdraw.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('BTCWithdraw component', () => {
6666
await waitFor(() => {
6767
expect(checkbox).toBeChecked();
6868
expect(screen.getByLabelText('feeRate')).toBeInTheDocument();
69-
expect(screen.getByTestId('fee-rate-unit')).toHaveTextContent('perkw');
69+
expect(screen.getByTestId('fee-rate-unit')).toHaveTextContent('Sat/vB');
7070
});
7171
});
7272

apps/frontend/src/components/cln/BTCWithdraw/BTCWithdraw.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,14 @@ const BTCWithdraw = (props) => {
229229
<AnimatePresence mode="wait">
230230
{showCustomFeeRate ? (
231231
<motion.div
232-
key="custom"
233-
initial={{ opacity: 0, scale: 0.95 }}
234-
animate={{ opacity: 1, scale: 1 }}
235-
exit={{ opacity: 0, scale: 0.9 }}
236-
transition={{ type: "spring", stiffness: 500, damping: 30 }}
232+
key="custom-fee-rate"
233+
initial={{ opacity: 0, y: -10 }}
234+
animate={{ opacity: 1, y: 0 }}
235+
exit={{ opacity: 0, y: 10 }}
236+
transition={{ duration: 0.2 }}
237+
style={{ width: '100%' }}
237238
>
238-
<Col xs={12} style={{ display: showCustomFeeRate ? 'block' : 'none' }}>
239+
<Col xs={12}>
239240
<Form.Label className='text-dark'>Fee Rate*</Form.Label>
240241
<InputGroup className={(feeRateHasError ? 'invalid ' : '')}>
241242
<InputGroup.Text className='form-control-addon form-control-addon-left'>
@@ -252,9 +253,10 @@ const BTCWithdraw = (props) => {
252253
value={feeRateValue}
253254
onChange={feeRateChangeHandler}
254255
onBlur={feeRateBlurHandler}
256+
data-testid='fee-rate-input'
255257
/>
256258
<InputGroup.Text data-testid='fee-rate-unit' id='Fee Rate Unit' className='form-control-addon form-control-addon-right text-light'>
257-
perkw
259+
Sat/vB
258260
</InputGroup.Text>
259261
</InputGroup>
260262
{(feeRateHasError) ?
@@ -264,13 +266,14 @@ const BTCWithdraw = (props) => {
264266
</motion.div>
265267
) : (
266268
<motion.div
267-
key="range"
268-
initial={{ opacity: 0, scale: 0.95 }}
269-
animate={{ opacity: 1, scale: 1 }}
270-
exit={{ opacity: 0, scale: 0.9 }}
271-
transition={{ type: "spring", stiffness: 500, damping: 30 }}
269+
key="fee-rate-range"
270+
initial={{ opacity: 0, y: -10 }}
271+
animate={{ opacity: 1, y: 0 }}
272+
exit={{ opacity: 0, y: 10 }}
273+
transition={{ duration: 0.2 }}
274+
style={{ width: '100%' }}
272275
>
273-
<Col xs={12} style={{ display: showCustomFeeRate ? 'none' : 'block' }}>
276+
<Col xs={12}>
274277
<FeerateRange tabIndex={4} selFeeRate={selFeeRate} selFeeRateChangeHandler={selFeeRateChangeHandler} />
275278
</Col>
276279
</motion.div>

0 commit comments

Comments
 (0)