diff --git a/package.json b/package.json index 08dec8ae..0cdb4ffe 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "scripts": { "dev": "cd paybutton && yarn dev", "build:dev": "yarn build:react && yarn dev", + "watch": "(cd paybutton && yarn dev) & (cd react && yarn dev)", "test": "cd react && yarn test", "test:coverage": "cd react && yarn test:coverage", "build:react": "cd react && yarn && yarn build", diff --git a/paybutton/dev/demo/paybutton-generator.html b/paybutton/dev/demo/paybutton-generator.html index 4cb19bc8..28e51269 100644 --- a/paybutton/dev/demo/paybutton-generator.html +++ b/paybutton/dev/demo/paybutton-generator.html @@ -11,7 +11,8 @@ } input, - button { + button, + select { padding: 8px; border-radius: 6px !important; border: 1px solid #ccc; @@ -77,6 +78,13 @@
+
+ + +
@@ -117,12 +125,16 @@
- +
+
+ + +
@@ -174,7 +186,8 @@
-
+ :enable-altpayment="paybuttonProps.enableAltpayment" + :op-return="paybuttonProps.opReturn">
diff --git a/react/lib/components/Widget/Widget.tsx b/react/lib/components/Widget/Widget.tsx index a4051285..c51d6842 100644 --- a/react/lib/components/Widget/Widget.tsx +++ b/react/lib/components/Widget/Widget.tsx @@ -159,7 +159,11 @@ const useStyles = makeStyles({ marginLeft: '4px', fontSize: '16px', } - } + }, + error: () => ({ + fontSize: '0.9rem !important', + color: '#EB3B3B !important', + }), }); @@ -451,7 +455,13 @@ export const Widget: React.FunctionComponent = props => { }), ); } catch (err) { + console.error(err); setErrorMsg((err as Error).message); + setDisabled(true) + setTimeout((): void => { + setErrorMsg('') + setText(`Send any amount of ${addressType}`); + }, 5000); } }, [props.opReturn, paymentId, disablePaymentId]); @@ -620,7 +630,7 @@ export const Widget: React.FunctionComponent = props => { textAlign="center" > {errorMsg ? ( - + {errorMsg} ) : (