All files / src/components/generate/qr Qr.tsx

0% Statements 0/13
100% Branches 1/1
100% Functions 1/1
0% Lines 0/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
import { FC } from 'react';
import QRCode from 'react-qr-code';
import styled from 'styled-components';
 
type Props = {
  visible_id: string;
};
 
const StyledQR = styled.div`
  display: inline-block;
  margin: 38.25px 0 0 10px;
  padding: 17.4285714px 17.4285714px 0 17.4285714px;
  //BUG: https://github.com/niklasvh/html2canvas/issues/2739
  // backgroundColor: "white";
  height: 147px;
  border: 2px solid rgb(0, 0, 0);
`;
 
const StyledHumanReadable = styled.p`
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 27px;
  font-family: ZeroXProto;
  font-weight: bold;
`;
 
const Qr: FC<Props> = (props) => {
  return (
    <StyledQR>
      <QRCode size={100} value={props.visible_id} bgColor={'#FFFFFF'} fgColor={'#ED6D1F'} />
      <StyledHumanReadable>{props.visible_id}</StyledHumanReadable>
    </StyledQR>
  );
};
 
export default Qr;