Browse Source

#46

feature/046
みてるぞ 5 days ago
parent
commit
674ac32817
3 changed files with 5 additions and 4 deletions
  1. +2
    -1
      frontend/src/components/PostEditForm.tsx
  2. +2
    -2
      frontend/src/components/PostList.tsx
  3. +1
    -1
      frontend/src/pages/posts/PostHistoryPage.tsx

+ 2
- 1
frontend/src/components/PostEditForm.tsx View File

@@ -36,7 +36,8 @@ export default (({ post, onSave }: Props) => {
useState<string | null> (post.originalCreatedBefore)
const [originalCreatedFrom, setOriginalCreatedFrom] =
useState<string | null> (post.originalCreatedFrom)
const [parentPostIds, setParentPostIds] = useState (post.parentPosts!.map (p => p.id).join (' '))
const [parentPostIds, setParentPostIds] =
useState ((post.parentPosts ?? []).map (p => p.id).join (' '))
const [tags, setTags] = useState<string> ('')
const [title, setTitle] = useState (post.title)



+ 2
- 2
frontend/src/components/PostList.tsx View File

@@ -42,8 +42,8 @@ export default (({ posts, onClick }: Props) => {
layoutId={layoutId}
className={cn ('w-full h-full overflow-hidden rounded-xl shadow',
'transform-gpu will-change-transform',
(post.childPosts ?? []).length > 0 && 'outline-4 border-green-500',
(post.parentPosts ?? []).length > 0 && 'outline-4 border-yellow-500')}
(post.childPosts ?? []).length > 0 && 'outline-4 outline-green-500',
(post.parentPosts ?? []).length > 0 && 'ring-4 ring-yellow-500')}
whileHover={{ scale: 1.02 }}
onLayoutAnimationStart={() => {
if (!(cardRef.current))


+ 1
- 1
frontend/src/pages/posts/PostHistoryPage.tsx View File

@@ -253,7 +253,7 @@ export default (() => {
.filter (t => t.slice (0, 5) !== 'nico:')
.join (' '),
parent_post_ids:
change.parentPosts
(change.parentPosts ?? [])
.filter (p => p.type !== 'removed')
.map (p => p.id)
.join (' '),


Loading…
Cancel
Save