-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add QR Code widget with full functionality and interactive demo #1334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/widgets/custom/QRCode.tsx
Outdated
| import { useEffect, useRef, useState, useMemo } from "react"; | ||
| import Field from "@/common/Field"; | ||
| import { WidgetProps } from "@/types"; | ||
| import QRCodeLib from "qrcode"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot ant design ja té un component per mostrar codis QR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right! I've refactored the implementation to use Ant Design's built-in QRCode component instead of the custom canvas implementation. This removes the external qrcode dependency and provides better integration with the existing Ant Design ecosystem. The widget maintains the same configuration options and functionality while being more maintainable.
…plementation Co-authored-by: ecarreras <[email protected]>
- Utilitzar Space per centrar el QRCode i el text - Substituir div per Typography.Text amb type secondary - Millorar l'alineació del valor mostrat sota el QR
|
Necessita gisce/ooui#207 |
|
@ecarreras Ho he pujat a Jo ho veig bé! |
|
@mguellsegarra lo del many2one estava fet expressament, el valor del QR ha ser ser l'is i el text que es mostra ha de ser l'string |
@ecarreras Sorry, ho he estat remenant per si podia veure el prompt original i lo que li havies demanat tu al Copilot però no me'n he sortit, saps com ho podria veure? He restaurat aquesta part i hauria d'estar disponible a la versió d'alpha - v3.0.0-alpha.565 |
|
Per mi ara funciona bé, nosé tot lo altre que hi ha afegit 🤷♂️ |
|
@mguellsegarra ho podem integrar això? |
Sí, no volia tocar res per la demo que tenieu, ara ho integro |
|
Vigent a la v2.101.0 |

QR Code Widget Implementation - Now Using Ant Design QRCode ✅
Updated Implementation
Refactored the QR Code widget to use Ant Design's built-in
QRCodecomponent instead of a custom canvas-based implementation, following the feedback from @ecarreras.✅ Changes Made
qrcodelibraryQRCodecomponent from antd 5.25.1qrcodeand@types/qrcodepackages🎯 Benefits of Using Ant Design QRCode
Advantages
Configuration Mapping
OOUI properties are mapped to Ant Design QRCode props:
width/size→sizepropertydarkColor→colorpropertylightColor→bgColorpropertyborder→borderedpropertyerrorCorrectionLevel→errorLevelpropertyborderRadius→style.borderRadiusshowValue→ custom display logic (unchanged)📱 Updated Demo & Screenshots
The interactive demo continues to work with all the same functionality:
Basic QR Code (200px) - Now with Ant Design
Large QR Code (300px) - Ant Design Component
🔧 Technical Implementation
QRCodefrom antd 5.25.1📋 Usage (Unchanged)
🏗️ Build Status
The refactored widget maintains full backward compatibility while leveraging Ant Design's robust QR code implementation. This addresses @ecarreras's feedback and improves the overall code quality and maintainability.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.