Skip to content

customization not working #91

@atharv-rem

Description

@atharv-rem
import { qrcode } from "etiket";

export default function EmployeeDetailPage({ params }: { params: { id: string } }) {
  // Generate the clean SVG string
  const qrSvg = qrcode(`https://yourportal.com/employee/${params.id}`, {
  size: 200,
  dotType: "dots",
  corners: {
    // Top Left: Red circular ring with a black dot center
    topLeft: { 
      outerShape: "dots",  // Changed from 'rounded' to 'dots' for symmetry
      innerShape: "dots", 
      outerColor: "#ff0000", 
      innerColor: "#000000" 
    },
    // Top Right: Black circular ring with a black dot center
    topRight: { 
      outerShape: "dots", 
      innerShape: "dots" 
    },
    // Bottom Left: Black circular ring with a black dot center
    bottomLeft: { 
      outerShape: "dots", 
      innerShape: "dots" 
    },
  },
});

  return (<div 
            style={{
              boxShadow: "0 226px 63px 0 rgba(212, 212, 212, 0.00), 0 145px 58px 0 rgba(212, 212, 212, 0.10)"
            }} 
            className="flex flex-col items-center justify-center w-[300px] h-[450px] bg-[#f8f8f8] rounded-[10px] border-[0.5px] border-[#d1cdcd] overflow-hidden"
          >
            {/* The QR Code Container */}
            <div 
              className="mb-[80px]" 
              dangerouslySetInnerHTML={{ __html: qrSvg }} 
            />

            {/* Employee Label Footer */}
          </div>
        </div>
      </div>
    </div>
  );
}

i am using this to create the QR but the qr looks like this
Image

also pls update the document on how to create qr code in react cus i found it very difficult to implement it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions