This repository has been archived by the owner on Feb 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Turn off Qr scanner after pasting from clipboard #203
Closed
Closed
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
209fc7b
allow continue button to disable qr scanner
benalleng 07116de
qr scanner is too damn big
benalleng 4a2f49e
add spacing and video size fix
benalleng 6beaa02
add spacing and video size fix
benalleng 1a6275f
fix setDestination not called
benalleng ac4bb0b
Merge branch 'master' of https://github.com/benalleng/mutiny-web-poc
benalleng ed90dd0
pull from upstream
benalleng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,3 +118,16 @@ dd { | |
*::-webkit-scrollbar { | ||
display: none; | ||
} | ||
|
||
.qrContainer { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for one-off styling I prefer inline tailwind when possible |
||
width: 70%; | ||
margin: 1rem auto 0 auto; | ||
} | ||
|
||
.inputContainer { | ||
width: 70%; | ||
margin: 0 auto auto auto; | ||
} | ||
.inputContainer > input { | ||
margin: 0 auto 1rem auto | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import { useNavigate } from "react-router"; | |
import Close from "../components/Close"; | ||
import PageTitle from "../components/PageTitle"; | ||
import ScreenMain from "../components/ScreenMain"; | ||
import { inputStyle } from "../styles"; | ||
import toast from "react-hot-toast" | ||
import MutinyToaster from "../components/MutinyToaster"; | ||
import { detectPaymentType, objectToSearchParams, PaymentType, toastAnything } from "@util/dumb"; | ||
|
@@ -12,7 +11,6 @@ import bip21 from "bip21" | |
import { NodeManager } from "node-manager"; | ||
import { QrCodeScanner } from "@components/QrCodeScanner"; | ||
import { SendConfirmParams } from "./SendConfirm"; | ||
import ActionButton from "@components/ActionButton"; | ||
import { useSearchParams } from "react-router-dom"; | ||
|
||
type UnifiedQrOptions = | ||
|
@@ -29,7 +27,7 @@ function Send() { | |
const { nodeManager } = useContext(NodeManagerContext); | ||
let navigate = useNavigate(); | ||
|
||
const [textFieldDestination, setDestination] = useState("") | ||
const [textFieldDestination] = useState("") | ||
|
||
const [searchParams] = useSearchParams(); | ||
const sendAll = searchParams.get("all") | ||
|
@@ -129,10 +127,6 @@ function Send() { | |
</header> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like it would help if the component would accept some onClose callback that overrides the default behavior of navigating to root, that way we can pass cleanup logic when necessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. referring to the |
||
<ScreenMain> | ||
<QrCodeScanner onValidCode={onValidCode} onCodeDetected={onCodeDetected} /> | ||
<input onChange={e => setDestination(e.target.value)} value={textFieldDestination} className={`w-full ${inputStyle({ accent: "green" })}`} type="text" placeholder='Paste invoice, pubkey, or address' /> | ||
<ActionButton onClick={() => handleContinue(undefined)}> | ||
Continue | ||
</ActionButton> | ||
</ScreenMain> | ||
<MutinyToaster /> | ||
</> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the move here is to raise this qrCodeRef up into Send.tsx, rather than lowering the navigate functions into here. that way Send.tsx can call anything it needs for cleanup on the ref.
ideally the QrCodeScanner stays rather dumb and generic (ideally it should handle other scenarios, like imagine it's being used for lnurl auth... it detects a valid qr code and then runs whatever callbacks have been passed to it from its parent.)