diff --git a/client/src/components/qr-editor/DesignPanel.tsx b/client/src/components/qr-editor/DesignPanel.tsx index 5f3e22f..dc7e00c 100644 --- a/client/src/components/qr-editor/DesignPanel.tsx +++ b/client/src/components/qr-editor/DesignPanel.tsx @@ -10,9 +10,12 @@ interface DesignPanelProps { export default function DesignPanel({ options, onChange }: DesignPanelProps) { const handleColorChange = (e: React.ChangeEvent) => { + const newColor = e.target.value; onChange({ ...options, - dotsOptions: { ...options.dotsOptions, color: e.target.value } + dotsOptions: { ...options.dotsOptions, color: newColor }, + cornersSquareOptions: { ...options.cornersSquareOptions, color: newColor }, + cornersDotOptions: { ...options.cornersDotOptions, color: newColor } }); }; @@ -30,13 +33,35 @@ export default function DesignPanel({ options, onChange }: DesignPanelProps) { }); }; + const handleLogoUpload = (e: React.ChangeEvent) => { + const file = e.target.files?.[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = (event) => { + const dataUrl = event.target?.result as string; + onChange({ + ...options, + image: dataUrl + }); + }; + reader.readAsDataURL(file); + }; + + const removeLogo = () => { + onChange({ + ...options, + image: undefined + }); + }; + return (

Design Customization

{/* Colors */}
- +
+ {/* Logo */} +
+ +
+ + {options.image && ( + + )} +
+
+ {/* Shapes */}