some unnecessary code removed from text-customizations

This commit is contained in:
Saimon8420 2024-12-31 16:31:15 +06:00
parent 3cfb7d0792
commit 714c732f7a

View file

@ -62,9 +62,9 @@ const TextCustomization = () => {
} }
} }
const updatePreview = (properties) => { // const updatePreview = (properties) => {
setPreviewText(text); // setPreviewText(text);
} // }
const applyChanges = () => { const applyChanges = () => {
updateActiveObject({ updateActiveObject({
@ -83,57 +83,47 @@ const TextCustomization = () => {
const handleTextChange = (newText) => { const handleTextChange = (newText) => {
setText(newText); setText(newText);
updatePreview({ text: newText });
setPreviewText(newText); setPreviewText(newText);
} }
const handleFontFamilyChange = (newFontFamily) => { const handleFontFamilyChange = (newFontFamily) => {
setFontFamily(newFontFamily); setFontFamily(newFontFamily);
updatePreview({ fontFamily: newFontFamily });
} }
const handleFontSizeChange = (newFontSize) => { const handleFontSizeChange = (newFontSize) => {
setFontSize(newFontSize) setFontSize(newFontSize)
updatePreview({ fontSize: newFontSize })
} }
const handleTextAlignChange = (newTextAlign) => { const handleTextAlignChange = (newTextAlign) => {
setTextAlign(newTextAlign) setTextAlign(newTextAlign)
updatePreview({ textAlign: newTextAlign })
} }
const handleFontStyleChange = () => { const handleFontStyleChange = () => {
const newFontStyle = fontStyle === 'normal' ? 'italic' : 'normal' const newFontStyle = fontStyle === 'normal' ? 'italic' : 'normal'
setFontStyle(newFontStyle) setFontStyle(newFontStyle)
updatePreview({ fontStyle: newFontStyle })
} }
const handleFontWeightChange = () => { const handleFontWeightChange = () => {
const newFontWeight = fontWeight === 'normal' ? 'bold' : 'normal' const newFontWeight = fontWeight === 'normal' ? 'bold' : 'normal'
setFontWeight(newFontWeight) setFontWeight(newFontWeight)
updatePreview({ fontWeight: newFontWeight })
} }
const handleLineHeightChange = (newLineHeight) => { const handleLineHeightChange = (newLineHeight) => {
setLineHeight(newLineHeight) setLineHeight(newLineHeight)
updatePreview({ lineHeight: newLineHeight })
} }
const handleCharSpacingChange = (newCharSpacing) => { const handleCharSpacingChange = (newCharSpacing) => {
setCharSpacing(newCharSpacing) setCharSpacing(newCharSpacing)
updatePreview({ charSpacing: newCharSpacing })
} }
const handleUnderlineChange = () => { const handleUnderlineChange = () => {
const newUnderline = !underline const newUnderline = !underline
setUnderline(newUnderline) setUnderline(newUnderline)
updatePreview({ underline: newUnderline })
} }
const handleLinethroughChange = () => { const handleLinethroughChange = () => {
const newLinethrough = !linethrough const newLinethrough = !linethrough
setLinethrough(newLinethrough) setLinethrough(newLinethrough)
updatePreview({ linethrough: newLinethrough })
} }
const content = () => { const content = () => {