From 3119d475e5ca4c05d80198fc4c2b3bec020aebbf Mon Sep 17 00:00:00 2001 From: miteruzo Date: Thu, 4 Sep 2025 23:55:09 +0900 Subject: [PATCH] =?UTF-8?q?#103=20=E3=82=BF=E3=82=B0=E8=A3=9C=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/PostEditForm.tsx | 15 ++-- frontend/src/components/PostFormTagsArea.tsx | 84 ++++++++++++++++++++ frontend/src/components/TagSearch.tsx | 4 +- frontend/src/components/TagSearchBox.tsx | 5 +- frontend/src/components/common/TextArea.tsx | 13 ++- frontend/src/pages/posts/PostListPage.tsx | 2 +- frontend/src/pages/posts/PostNewPage.tsx | 19 ++--- 7 files changed, 108 insertions(+), 34 deletions(-) create mode 100644 frontend/src/components/PostFormTagsArea.tsx diff --git a/frontend/src/components/PostEditForm.tsx b/frontend/src/components/PostEditForm.tsx index e40c09e..a254ce1 100644 --- a/frontend/src/components/PostEditForm.tsx +++ b/frontend/src/components/PostEditForm.tsx @@ -2,7 +2,8 @@ import axios from 'axios' import toCamel from 'camelcase-keys' import { useState } from 'react' -import TextArea from '@/components/common/TextArea' +import PostFormTagsArea from '@/components/PostFormTagsArea' +import Label from '@/components/common/Label' import { Button } from '@/components/ui/button' import { API_BASE_URL } from '@/config' @@ -24,7 +25,7 @@ export default (({ post, onSave }: Props) => { const handleSubmit = async () => { const res = await axios.put (`${ API_BASE_URL }/posts/${ post.id }`, { title, tags }, { headers: { 'Content-Type': 'multipart/form-data', - 'X-Transfer-Code': localStorage.getItem ('user_code') || '' } } ) + 'X-Transfer-Code': localStorage.getItem ('user_code') ?? '' } } ) const data = toCamel (res.data as any, { deep: true }) as Post onSave ({ ...post, title: data.title, @@ -35,9 +36,7 @@ export default (({ post, onSave }: Props) => {
{/* タイトル */}
-
- -
+ {
{/* タグ */} -
- -