Skip to content

Commit e7508eb

Browse files
committed
development mode
1 parent 12c0342 commit e7508eb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/widgets.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const loadingSVG = (<svg xmlns="http://www.w3.org/2000/svg" width="50" height="5
2727
</path>
2828
</svg>);
2929

30+
const developmentMode = false;
3031

3132
export const ConnectQR = ({ mobile, level = 'H', size = null, label = qrCodeLabel, loading = loadingSVG, maxSize = 400, vspace = 130, hspace = 50 }) => {
3233
const [optimumSize, setOptimumSize] = useState(0);
@@ -61,6 +62,19 @@ export const ConnectQR = ({ mobile, level = 'H', size = null, label = qrCodeLabe
6162
if ((!mobile.connectionCode) || size === 0) {
6263
return null;
6364
}
65+
if(developmentMode && window.location.hostname==='localhost' && navigator.clipboard && navigator.clipboard.writeText){
66+
67+
return (
68+
<div style={styles.qrCode} onClick={() => {
69+
navigator.clipboard.writeText(mobile.connectionCode);
70+
}}>
71+
<QRCodeSVG value={mobile.connectionCode} level={level} size={size ? size : optimumSize} />
72+
{label}
73+
</div>
74+
);
75+
76+
}
77+
6478
return (
6579
<div style={styles.qrCode}>
6680
<QRCodeSVG value={mobile.connectionCode} level={level} size={size ? size : optimumSize} />

0 commit comments

Comments
 (0)