From 79989d95294fa442a2a3b607bca3511d263ac64a Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:17:08 +0330 Subject: [PATCH] Import source: src/components/RightPanel/ColorsSection Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/components/RightPanel/ColorsSection.tsx | 73 +++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/components/RightPanel/ColorsSection.tsx diff --git a/src/components/RightPanel/ColorsSection.tsx b/src/components/RightPanel/ColorsSection.tsx new file mode 100644 index 0000000..e3e1a01 --- /dev/null +++ b/src/components/RightPanel/ColorsSection.tsx @@ -0,0 +1,73 @@ +import { useRef } from 'react'; +import { useQR } from '../../context/QRContext'; +import { ColorSwatch } from '../ui/ColorSwatch'; +import { QR_COLORS, BG_COLORS } from '../../config/styleOptions'; + +export function ColorsSection() { + const { state, dispatch } = useQR(); + const qrPickerRef = useRef(null); + const bgPickerRef = useRef(null); + + return ( +
+

Colors

+ +
+ QR Code +
+ {QR_COLORS.map(color => ( + dispatch({ type: 'SET_QR_COLOR', payload: color })} /> + ))} + {/* Custom picker */} + +
+ {!QR_COLORS.includes(state.qrColor) && ( +
+
+ {state.qrColor} +
+ )} +
+ +
+ Background +
+ {BG_COLORS.map((color, i) => ( + dispatch({ type: 'SET_BG_COLOR', payload: color })} /> + ))} + {/* Custom bg picker */} + +
+
+
+ ); +}