Skip to content

Commit

Permalink
feat: ui
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Nov 1, 2023
1 parent 0d1033a commit e5f6e8f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/common/productQrcode.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import classNames from 'classnames';
import QRCode from 'qrcode.react';
import { Carbon3Name, DisableQrcode } from '../svgr';
import { Border, Carbon3Name, DisableQrcode } from '../svgr';
import { Fragment } from 'react';

export function ProductQrcode(p: any) {
const { qrText, className, qrcodeDisable, data, name = 'Certified' } = p;
Expand All @@ -20,10 +21,14 @@ export function ProductQrcode(p: any) {
<p className="text-[0.6875rem] text-center mb-2 leading-[0.945rem] font-semibold mo:leading-[0.865rem]">
{qrText ? qrText : `Product Carbon Footprint ${name}`}
</p>

<Border className={'relative z-100'} />
{qrcodeDisable ? (
<DisableQrcode width="92" height="92" />
<DisableQrcode className="" width="77" height="77" />
) : (
<QRCode className="w-[5.75rem]" size={92} value={data} />
<>
<QRCode className="w-[5.75rem] absolute z-1000 mo:mt-12 md:mt-13 mt-[50px]" size={76} value={data} />
</>
)}
</div>
</div>
Expand Down
22 changes: 22 additions & 0 deletions src/components/svgr/Border.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as React from 'react';
const SvgBorder = (props) => (
<svg {...props} width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M24.9546 0.253342H17.7344C8.16406 0.253342 0.405762 8.01165 0.405762 17.582V25.0429H8.10738V17.582C8.10738 12.2651 12.4175 7.95497 17.7344 7.95497H24.9546V0.253342Z"
fill="black"
/>
<path
d="M74.7744 7.95497V0.253342H82.2355C91.8058 0.253342 99.5641 8.01165 99.5641 17.582V25.0429H91.8625V17.582C91.8625 12.2651 87.5523 7.95497 82.2355 7.95497H74.7744Z"
fill="black"
/>
<path
d="M74.7744 91.7102H82.2355C87.5523 91.7102 91.8625 87.4 91.8625 82.0831V74.8629H99.5641V82.0831C99.5641 91.6535 91.8058 99.4118 82.2355 99.4118H74.7744V91.7102Z"
fill="black"
/>
<path
d="M8.10738 74.8628V82.0831C8.10738 87.4 12.4175 91.7102 17.7344 91.7102H24.9546V99.4118H17.7344C8.16406 99.4118 0.405762 91.6535 0.405762 82.0831V74.8628H8.10738Z"
fill="black"
/>
</svg>
);
export default SvgBorder;
1 change: 1 addition & 0 deletions src/components/svgr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ export { default as VerifiedIcon } from './VerifiedIcon';
export { default as Nft } from './Nft';
export { default as GGX } from './Ggx';
export { default as Detail } from './Detail';
export { default as Border } from './Border';

0 comments on commit e5f6e8f

Please sign in to comment.