mail page fix design
This commit is contained in:
parent
7c655dafcf
commit
58c67d980f
@ -53,19 +53,10 @@ export default function ComposeEmail({
|
|||||||
|
|
||||||
const handleInput = (e: React.FormEvent<HTMLDivElement>) => {
|
const handleInput = (e: React.FormEvent<HTMLDivElement>) => {
|
||||||
if (composeBodyRef.current) {
|
if (composeBodyRef.current) {
|
||||||
const content = composeBodyRef.current.textContent || '';
|
setComposeBody(composeBodyRef.current.innerHTML);
|
||||||
setComposeBody(content);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (composeBodyRef.current) {
|
|
||||||
composeBodyRef.current.innerHTML = '';
|
|
||||||
const textNode = document.createTextNode(composeBody);
|
|
||||||
composeBodyRef.current.appendChild(textNode);
|
|
||||||
}
|
|
||||||
}, [composeBody]);
|
|
||||||
|
|
||||||
const handleFileAttachment = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleFileAttachment = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
if (!e.target.files) return;
|
if (!e.target.files) return;
|
||||||
|
|
||||||
@ -215,24 +206,21 @@ export default function ComposeEmail({
|
|||||||
|
|
||||||
{/* Message Body */}
|
{/* Message Body */}
|
||||||
<div className="flex-1 min-h-[200px] overflow-auto">
|
<div className="flex-1 min-h-[200px] overflow-auto">
|
||||||
<Label htmlFor="message" className="block text-sm font-medium text-gray-700">Message</Label>
|
|
||||||
<div
|
<div
|
||||||
ref={composeBodyRef}
|
ref={composeBodyRef}
|
||||||
contentEditable
|
contentEditable
|
||||||
id="message"
|
className="prose max-w-none min-h-[200px] p-4 border border-gray-300 rounded-lg bg-white"
|
||||||
className="w-full mt-1 min-h-[200px] p-4 border border-gray-300 rounded-md bg-white text-gray-900"
|
|
||||||
style={{
|
style={{
|
||||||
|
color: '#000000',
|
||||||
cursor: 'text',
|
cursor: 'text',
|
||||||
whiteSpace: 'pre-wrap',
|
whiteSpace: 'pre-wrap',
|
||||||
wordBreak: 'break-word',
|
wordBreak: 'break-word',
|
||||||
fontFamily: 'inherit',
|
fontFamily: 'inherit',
|
||||||
fontSize: 'inherit',
|
fontSize: 'inherit',
|
||||||
lineHeight: 'inherit',
|
lineHeight: 'inherit',
|
||||||
unicodeBidi: 'normal',
|
|
||||||
direction: 'ltr'
|
|
||||||
}}
|
}}
|
||||||
|
dangerouslySetInnerHTML={{ __html: composeBody }}
|
||||||
onInput={handleInput}
|
onInput={handleInput}
|
||||||
suppressContentEditableWarning
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user