Skip to content

Commit

Permalink
Merge branch 'fix/ONE-3063-qr-code-padding' into 'main'
Browse files Browse the repository at this point in the history
[ONE-3063] Added customizable qr code padding

Closes ONE-3063

See merge request procivis/one/one-react-native-components!135
  • Loading branch information
procivisAG committed Aug 28, 2024
2 parents 43e8046 + 2ba4d64 commit db5116d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@procivis/one-react-native-components",
"version": "0.1.33",
"version": "0.1.34",
"description": "Common Procivis ONE UI components for react-native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
7 changes: 4 additions & 3 deletions src/credential/credential-carousel-images.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,19 @@ export const Barcode: FC<BarcodeProps> = ({ content, width = 220, height = 80, t

type QrCodeProps = {
content: string;
padding?: number;
testID?: string;
};

export const QrCode: FC<QrCodeProps> = ({ content, testID }) => {
export const QrCode: FC<QrCodeProps> = ({ content, padding, testID }) => {
const qrCodeXml = useMemo(() => {
return new QRCode({
container: 'svg-viewbox',
content,
join: true,
padding: 1,
padding: padding ?? 1,
}).svg();
}, [content]);
}, [content, padding]);
return <SvgXml height={'100%'} testID={testID} width={'100%'} xml={qrCodeXml} />;
};

Expand Down

0 comments on commit db5116d

Please sign in to comment.