feat(ui): integrate RichTextEditor for product full description and add click-outside handlers for dropdowns
Deploy Canina / deploy (push) Successful in 1m35s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s

This commit is contained in:
parsa aghaei committed 2026-08-29 08:46:41 +03:30
1 parent 1651a593bd
commit bfb7f42065
18 files changed
+150012 -5970

No files matched your search

@@ -87,6 +87,22 @@ export default function RichTextEditor({
const [isFullscreen, setIsFullscreen] = useState(false);
const [showColorPicker, setShowColorPicker] = useState(false);
const [showBgColorPicker, setShowBgColorPicker] = useState(false);
const colorPickerRef = useRef<HTMLDivElement>(null);
const bgColorPickerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (colorPickerRef.current && !colorPickerRef.current.contains(event.target as Node)) {
setShowColorPicker(false);
}
if (bgColorPickerRef.current && !bgColorPickerRef.current.contains(event.target as Node)) {
setShowBgColorPicker(false);
}
};
document.addEventListener('mousedown', handleClickOutside);
return () => document.removeEventListener('mousedown', handleClickOutside);
}, []);
const [customColor, setCustomColor] = useState('#111827');
const [customBgColor, setCustomBgColor] = useState('#fef08a');
@@ -608,7 +624,7 @@ export default function RichTextEditor({
</div>
{/* Text Color Picker */}
<div className="relative">
<div ref={colorPickerRef} className="relative">
<button
type="button"
disabled={isCodeMode}
@@ -674,7 +690,7 @@ export default function RichTextEditor({
</div>
{/* Background Color Picker */}
<div className="relative">
<div ref={bgColorPickerRef} className="relative">
<button
type="button"
disabled={isCodeMode}