-
Notifications
You must be signed in to change notification settings - Fork 19
Add an option to hide the send button in the widget #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,7 @@ const allowedProps = [ | |
| 'currency', | ||
| 'displayCurrency', | ||
| 'hideToasts', | ||
| 'hideSendButton', | ||
|
Contributor
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. 🧩 Analysis chain🏁 Script executed: # Get context around line 85 in index.tsx
sed -n '75,95p' paybutton/src/index.tsxRepository: PayButton/paybutton Length of output: 333 🏁 Script executed: # Get context around line 190 in index.tsx
sed -n '180,200p' paybutton/src/index.tsxRepository: PayButton/paybutton Length of output: 720 🏁 Script executed: # Search for hideSendButton usage in Widget.tsx
rg 'hideSendButton' paybutton/src/ -B 2 -A 2Repository: PayButton/paybutton Length of output: 269 🏁 Script executed: # Check the entire allowedProps and attributes handling section
sed -n '70,210p' paybutton/src/index.tsxRepository: PayButton/paybutton Length of output: 3695 🏁 Script executed: # Find and examine Widget.tsx to see how hideSendButton is used
find paybutton/src -name 'Widget*' -type fRepository: PayButton/paybutton Length of output: 45 🏁 Script executed: # Search for how hideSendButton is conditionally used in the codebase
rg 'hideSendButton' paybutton/src -B 3 -A 3Repository: PayButton/paybutton Length of output: 350 🏁 Script executed: # Check if there are any boolean coercions for hideSendButton elsewhere
rg "hideSendButton.*===" paybutton/srcRepository: PayButton/paybutton Length of output: 45 🏁 Script executed: # Search for Widget component definition
rg 'Widget' paybutton/src --type tsx --type ts | head -20Repository: PayButton/paybutton Length of output: 90 🏁 Script executed: # Look for all tsx/ts files
find paybutton/src -name '*.tsx' -o -name '*.ts'Repository: PayButton/paybutton Length of output: 86 🏁 Script executed: # Search for where hideSendButton is actually used in component logic
rg 'hideSendButton' . -B 5 -A 5 --type tsx --type tsRepository: PayButton/paybutton Length of output: 90 🏁 Script executed: # List all files in paybutton/src
ls -la paybutton/src/Repository: PayButton/paybutton Length of output: 232 🏁 Script executed: # Search for hideSendButton without file type restrictions
rg 'hideSendButton' paybutton/ -B 5 -A 5Repository: PayButton/paybutton Length of output: 3482 🏁 Script executed: # Check if Widget is imported or defined
rg 'Widget' paybutton/src -B 2 -A 2Repository: PayButton/paybutton Length of output: 1984 🏁 Script executed: # Verify the exact lines around the hideToasts coercion to ensure nothing was missed
sed -n '185,195p' paybutton/src/index.tsxRepository: PayButton/paybutton Length of output: 404
Every HTML attribute read through props.hideToasts = attributes.hideToasts === 'true';
Note: the new Widget tests pass 🐛 Proposed fix props.hideToasts = attributes.hideToasts === 'true';
+ props.hideSendButton = attributes.hideSendButton === 'true';Also applies to: 190-190 🤖 Prompt for AI Agents |
||
| 'hoverText', | ||
| 'onSuccess', | ||
| 'onTransaction', | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -115,6 +115,7 @@ export interface WidgetProps { | |||||
| newTxText?: string; | ||||||
| transactionText?: string; | ||||||
| convertedCurrencyObj?: CurrencyObject; | ||||||
| hideSendButton?: boolean; | ||||||
| setConvertedCurrencyObj?: Function; | ||||||
| setPaymentId?: Function; | ||||||
| } | ||||||
|
|
@@ -203,6 +204,7 @@ export const Widget: React.FunctionComponent<WidgetProps> = props => { | |||||
| donationRate = DEFAULT_DONATION_RATE, | ||||||
| setConvertedCurrencyObj = () => {}, | ||||||
| setPaymentId, | ||||||
| hideSendButton, | ||||||
| } = props; | ||||||
| const [loading, setLoading] = useState(true); | ||||||
| const [draftAmount, setDraftAmount] = useState<string>("") | ||||||
|
|
@@ -1347,7 +1349,7 @@ export const Widget: React.FunctionComponent<WidgetProps> = props => { | |||||
| </Box> | ||||||
| ) : null} | ||||||
|
|
||||||
| {success ? null : ( | ||||||
| {success || hideSendButton ? null : ( | ||||||
|
Contributor
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check isPropsTrue usage in Widget.tsx and surrounding boolean prop checks
rg -n "isPropsTrue" react/lib/components/Widget/Widget.tsxRepository: PayButton/paybutton Length of output: 469 🏁 Script executed: #!/bin/bash
# Get lines around 1352 to see the hideSendButton check
sed -n '1345,1395p' react/lib/components/Widget/Widget.tsxRepository: PayButton/paybutton Length of output: 1830 🏁 Script executed: #!/bin/bash
# Get lines around 1276, 1360, 1368 to compare boolean prop usage
echo "=== Line 1276 (editable) ===" && sed -n '1270,1280p' react/lib/components/Widget/Widget.tsx
echo -e "\n=== Line 1360 (disabled) ===" && sed -n '1355,1365p' react/lib/components/Widget/Widget.tsx
echo -e "\n=== Line 1368 (disableAltpayment) ===" && sed -n '1363,1375p' react/lib/components/Widget/Widget.tsxRepository: PayButton/paybutton Length of output: 1430 🏁 Script executed: #!/bin/bash
# Verify hideSendButton prop definition and destructuring
rg -n "hideSendButton" react/lib/components/Widget/Widget.tsx | head -20Repository: PayButton/paybutton Length of output: 173 🏁 Script executed: #!/bin/bash
# Find the Vue demo file to check string attribute handling
find . -type f \( -name "*.vue" -o -name "*demo*.html" -o -name "*demo*.tsx" \) | head -20Repository: PayButton/paybutton Length of output: 45
Every other boolean flag prop uses Proposed fix- {success || hideSendButton ? null : (
+ {success || isPropsTrue(hideSendButton) ? null : (📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| <Box pt={2} flex={1} sx={classes.button_container}> | ||||||
| { | ||||||
| // Use createElement to avoid JSX element-type incompatibility from duplicate React types | ||||||
|
|
||||||
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.
Missing closing
**in the blockquote description.Every other parameter description in this file closes the bold span before the period (e.g.,
> **The 'hide-toasts' parameter ... detected.**). Line 847 leaves the bold open.📝 Proposed fix
(The fix above also drops the wordy "or not", per the LanguageTool style hint.)
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[style] ~847-~847: ‘whether or not’ might be wordy. Consider a shorter alternative.
Context: ... ‘hide-send-button’ parameter specifies whether or not the 'Send with XEC/BCH' button should b...
(EN_WORDINESS_PREMIUM_WHETHER_OR_NOT)
🤖 Prompt for AI Agents