Added margin option to QR code component

This commit is contained in:
Alejandro Celaya
2021-02-14 10:16:30 +01:00
parent f9da22c5a1
commit c95cb144a8
4 changed files with 66 additions and 19 deletions

View File

@@ -24,7 +24,7 @@ export const buildQrCodeUrl = (
const query = stringifyQuery({
size: useSizeInPath ? undefined : size,
format: svgIsSupported ? format : undefined,
margin: marginIsSupported ? margin : undefined,
margin: marginIsSupported && margin > 0 ? margin : undefined,
});
return `${baseUrl}${isEmpty(query) ? '' : `?${query}`}`;