Skip to content

Commit 50c5f3b

Browse files
im-adithyaAdithya Vardhan
and
Adithya Vardhan
authored
Push buttons to bottom in Send and Receive Screens (#1672)
* fix: remove extra margins on container * fix: push buttons to bottom in send and receive screens Also fixes green background issue #1650 * fix: add discernible text for button Co-authored-by: Adithya Vardhan <[email protected]>
1 parent d0f093f commit 50c5f3b

File tree

3 files changed

+65
-68
lines changed

3 files changed

+65
-68
lines changed

src/app/components/Container.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Container({
2929

3030
return (
3131
<div
32-
className={`container mx-auto px-4 mb-4 ${getMaxWidthClass(maxWidth)} ${
32+
className={`container mx-auto px-4 ${getMaxWidthClass(maxWidth)} ${
3333
justifyBetween
3434
? "h-full flex flex-col justify-between overflow-y-auto no-scrollbar"
3535
: ""

src/app/screens/Receive/index.tsx

+47-51
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function Receive() {
122122
function renderInvoice() {
123123
if (!invoice) return null;
124124
return (
125-
<div>
125+
<div className="py-4">
126126
<div className="relative p-8 bg-white rounded-lg shadow-sm ring-1 ring-black ring-opacity-5 flex justify-center items-center overflow-hidden">
127127
<QRCode value={invoice.paymentRequest.toUpperCase()} level="M" />
128128
{paid && (
@@ -191,7 +191,7 @@ function Receive() {
191191
}
192192

193193
return (
194-
<div>
194+
<div className="h-full flex flex-col overflow-y-auto no-scrollbar">
195195
<Header
196196
title={t("title")}
197197
headerLeft={
@@ -201,56 +201,52 @@ function Receive() {
201201
/>
202202
}
203203
/>
204-
<div className="py-4">
205-
<Container maxWidth="sm">
206-
<div className={`${paid ? "bg-green-bitcoin" : ""}`}>
207-
{invoice ? (
208-
renderInvoice()
209-
) : (
210-
<form
211-
onSubmit={(e: FormEvent) => {
212-
e.preventDefault();
213-
createInvoice();
214-
}}
215-
>
216-
<div className="mb-4">
217-
<DualCurrencyField
218-
id="amount"
219-
min={0}
220-
label={t("amount.label")}
221-
placeholder={t("amount.placeholder")}
222-
fiatValue={fiatAmount}
223-
onChange={handleChange}
224-
autoFocus
225-
/>
226-
</div>
227-
228-
<div className="mb-4">
229-
<TextField
230-
id="description"
231-
label={t("description.label")}
232-
placeholder={t("description.placeholder")}
233-
onChange={handleChange}
234-
/>
235-
</div>
204+
{invoice ? (
205+
<Container maxWidth="sm">{renderInvoice()}</Container>
206+
) : (
207+
<form
208+
onSubmit={(e: FormEvent) => {
209+
e.preventDefault();
210+
createInvoice();
211+
}}
212+
className="h-full"
213+
>
214+
<Container justifyBetween maxWidth="sm">
215+
<div className="py-4">
216+
<div className="mb-4">
217+
<DualCurrencyField
218+
id="amount"
219+
min={0}
220+
label={t("amount.label")}
221+
placeholder={t("amount.placeholder")}
222+
fiatValue={fiatAmount}
223+
onChange={handleChange}
224+
autoFocus
225+
/>
226+
</div>
236227

237-
<div className="text-center mb-4">
238-
<div className="mb-4">
239-
<Button
240-
type="submit"
241-
label={t("actions.create_invoice")}
242-
fullWidth
243-
primary
244-
loading={loading}
245-
disabled={loading}
246-
/>
247-
</div>
248-
</div>
249-
</form>
250-
)}
251-
</div>
252-
</Container>
253-
</div>
228+
<div className="mb-4">
229+
<TextField
230+
id="description"
231+
label={t("description.label")}
232+
placeholder={t("description.placeholder")}
233+
onChange={handleChange}
234+
/>
235+
</div>
236+
</div>
237+
<div className="mb-4">
238+
<Button
239+
type="submit"
240+
label={t("actions.create_invoice")}
241+
fullWidth
242+
primary
243+
loading={loading}
244+
disabled={loading}
245+
/>
246+
</div>
247+
</Container>
248+
</form>
249+
)}
254250
</div>
255251
);
256252
}

src/app/screens/Send/index.tsx

+17-16
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function Send() {
154154
}
155155

156156
return (
157-
<div>
157+
<div className="h-full flex flex-col overflow-y-auto no-scrollbar">
158158
<Header
159159
title={t("title")}
160160
headerLeft={
@@ -164,9 +164,9 @@ function Send() {
164164
/>
165165
}
166166
/>
167-
<div className="py-4">
168-
<Container maxWidth="sm">
169-
<form onSubmit={handleSubmit}>
167+
<form onSubmit={handleSubmit} className="h-full">
168+
<Container justifyBetween maxWidth="sm">
169+
<div className="pt-4">
170170
<TextField
171171
id="invoice"
172172
label={t("input.label")}
@@ -181,6 +181,7 @@ function Send() {
181181
}
182182
endAdornment={
183183
<button
184+
aria-label="Scan QR"
184185
type="button"
185186
className="flex justify-center items-center w-10 h-8"
186187
onClick={() => setQrIsOpen(true)}
@@ -189,19 +190,19 @@ function Send() {
189190
</button>
190191
}
191192
/>
192-
<div className="mt-4">
193-
<Button
194-
type="submit"
195-
label={tCommon("actions.continue")}
196-
primary
197-
fullWidth
198-
loading={loading}
199-
disabled={invoice === "" || loading}
200-
/>
201-
</div>
202-
</form>
193+
</div>
194+
<div className="my-4">
195+
<Button
196+
type="submit"
197+
label={tCommon("actions.continue")}
198+
primary
199+
fullWidth
200+
loading={loading}
201+
disabled={invoice === "" || loading}
202+
/>
203+
</div>
203204
</Container>
204-
</div>
205+
</form>
205206
</div>
206207
);
207208
}

0 commit comments

Comments
 (0)