mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +00:00
wallet and card resizing
This commit is contained in:
1 parent
4f2bfa4d5b
commit
c3b1adc375
3 files changed
+35
-5
No files matched your search
@@ -617,7 +617,7 @@ export function CashuWallet() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LoadingModal isLoading={isLoading || !isInitialized} />
|
<LoadingModal isLoading={isLoading || !isInitialized} />
|
||||||
<div className="container mx-auto py-1 px-3 sm:px-4 relative">
|
<div className="max-w-4xl mx-auto py-1 px-3 sm:px-4 relative">
|
||||||
|
|
||||||
|
|
||||||
{/* ========================================================================
|
{/* ========================================================================
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export function ReceiveCard({
|
|||||||
<Download className="h-5 w-5 mr-2" />
|
<Download className="h-5 w-5 mr-2" />
|
||||||
Receive
|
Receive
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription className="min-h-[2.5rem] flex items-center">
|
||||||
{mode === 'tokens'
|
{mode === 'tokens'
|
||||||
? 'Enter Cashu token to redeem'
|
? 'Enter Cashu token to redeem'
|
||||||
: 'Deposit funds with Lightning'
|
: 'Deposit funds with Lightning'
|
||||||
@@ -51,6 +51,11 @@ export function ReceiveCard({
|
|||||||
placeholder="cashuBo2Ft..."
|
placeholder="cashuBo2Ft..."
|
||||||
value={tokenInput}
|
value={tokenInput}
|
||||||
onChange={(e) => setTokenInput(e.target.value)}
|
onChange={(e) => setTokenInput(e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && tokenInput.trim() && activeMintUrl && !isLoading) {
|
||||||
|
onReceive();
|
||||||
|
}
|
||||||
|
}}
|
||||||
className="flex-1"
|
className="flex-1"
|
||||||
disabled={!activeMintUrl}
|
disabled={!activeMintUrl}
|
||||||
/>
|
/>
|
||||||
@@ -73,6 +78,11 @@ export function ReceiveCard({
|
|||||||
type="number"
|
type="number"
|
||||||
value={quoteAmount}
|
value={quoteAmount}
|
||||||
onChange={(e) => setQuoteAmount(e.target.value)}
|
onChange={(e) => setQuoteAmount(e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && quoteAmount && activeMintUrl && !isLoading) {
|
||||||
|
onReceive();
|
||||||
|
}
|
||||||
|
}}
|
||||||
disabled={!activeMintUrl}
|
disabled={!activeMintUrl}
|
||||||
/>
|
/>
|
||||||
<Button onClick={onReceive} disabled={!quoteAmount || !activeMintUrl || isLoading}>
|
<Button onClick={onReceive} disabled={!quoteAmount || !activeMintUrl || isLoading}>
|
||||||
|
|||||||
@@ -45,11 +45,16 @@ export function SendCard({
|
|||||||
<Send className="h-5 w-5 mr-2" />
|
<Send className="h-5 w-5 mr-2" />
|
||||||
Send
|
Send
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription className="min-h-[2.5rem] flex items-center">
|
||||||
{mode === 'tokens'
|
{mode === 'tokens'
|
||||||
? 'Generate Cashu token to send'
|
? 'Generate Cashu token to send'
|
||||||
: pendingLightningAddress
|
: pendingLightningAddress
|
||||||
? `Sending to: ${pendingLightningAddress}`
|
? (
|
||||||
|
<span className="inline-block px-3 py-1.5 bg-primary/10 border border-primary/20 rounded-md">
|
||||||
|
<span className="font-bold text-primary">Sending to:</span>{' '}
|
||||||
|
<span className="font-semibold text-foreground">{pendingLightningAddress}</span>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
: 'Pay Lightning invoices or addresses from balance'
|
: 'Pay Lightning invoices or addresses from balance'
|
||||||
}
|
}
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
@@ -68,6 +73,11 @@ export function SendCard({
|
|||||||
type="number"
|
type="number"
|
||||||
value={sendAmount}
|
value={sendAmount}
|
||||||
onChange={(e) => setSendAmount(e.target.value)}
|
onChange={(e) => setSendAmount(e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && sendAmount && activeMintUrl && !isLoading) {
|
||||||
|
onSend();
|
||||||
|
}
|
||||||
|
}}
|
||||||
disabled={!activeMintUrl}
|
disabled={!activeMintUrl}
|
||||||
/>
|
/>
|
||||||
<Button onClick={onSend} disabled={!sendAmount || !activeMintUrl || isLoading}>
|
<Button onClick={onSend} disabled={!sendAmount || !activeMintUrl || isLoading}>
|
||||||
@@ -92,6 +102,11 @@ export function SendCard({
|
|||||||
type="number"
|
type="number"
|
||||||
value={lightningAddressAmount}
|
value={lightningAddressAmount}
|
||||||
onChange={(e) => setLightningAddressAmount(e.target.value)}
|
onChange={(e) => setLightningAddressAmount(e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && lightningAddressAmount && activeMintUrl && !isResolvingAddress && !isLoading) {
|
||||||
|
onSend();
|
||||||
|
}
|
||||||
|
}}
|
||||||
autoFocus
|
autoFocus
|
||||||
disabled={!activeMintUrl}
|
disabled={!activeMintUrl}
|
||||||
/>
|
/>
|
||||||
@@ -129,7 +144,7 @@ export function SendCard({
|
|||||||
// Step 1: Show invoice/address input
|
// Step 1: Show invoice/address input
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Input
|
<Input
|
||||||
placeholder="Lightning invoice (lnbc...) or address ([email protected])"
|
placeholder="lnbc... or [email protected]"
|
||||||
value={lightningInvoice || lightningAddressInput}
|
value={lightningInvoice || lightningAddressInput}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
@@ -141,6 +156,11 @@ export function SendCard({
|
|||||||
setLightningAddressInput('');
|
setLightningAddressInput('');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter' && (lightningInvoice.trim() || lightningAddressInput.trim()) && activeMintUrl && !isLoading) {
|
||||||
|
onSend();
|
||||||
|
}
|
||||||
|
}}
|
||||||
className="flex-1"
|
className="flex-1"
|
||||||
disabled={!activeMintUrl}
|
disabled={!activeMintUrl}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user