글쓰기

This commit is contained in:
mota
2025-11-02 11:33:44 +09:00
parent 9ff08d3e58
commit 9e02aa3a88
7 changed files with 141 additions and 10 deletions

View File

@@ -107,7 +107,10 @@ export default function NewPostPage() {
<span aria-hidden>🙂</span>
<UploadButton
multiple
onUploaded={(url) => setForm((f) => ({ ...f, content: `${f.content}\n![image](${url})` }))}
onUploaded={(url) => {
const figure = `<figure style="margin:8px 0; position: relative; display: inline-block;" data-resizable="true"><img src="${url}" alt="" style="max-width: 100%; height: auto; display: block; cursor: pointer;" /><div class="resize-handle" style="position: absolute; bottom: 0; right: 0; width: 16px; height: 16px; background: #f94b37; cursor: se-resize; border-radius: 50% 0 0 0; opacity: 0.8;"></div><button class="delete-image-btn" style="position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; background: rgba(0, 0, 0, 0.6); color: white; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; opacity: 0.8;" title="이미지 삭제">×</button></figure>`;
setForm((f) => ({ ...f, content: `${f.content}\n${figure}` }));
}}
{...(boardSlug ? require("@/lib/photoPresets").getPhotoPresetBySlug(boardSlug) : {})}
/>
</div>