| @@ -36,7 +36,8 @@ export default (({ post, onSave }: Props) => { | |||||
| useState<string | null> (post.originalCreatedBefore) | useState<string | null> (post.originalCreatedBefore) | ||||
| const [originalCreatedFrom, setOriginalCreatedFrom] = | const [originalCreatedFrom, setOriginalCreatedFrom] = | ||||
| useState<string | null> (post.originalCreatedFrom) | 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 [tags, setTags] = useState<string> ('') | ||||
| const [title, setTitle] = useState (post.title) | const [title, setTitle] = useState (post.title) | ||||
| @@ -42,8 +42,8 @@ export default (({ posts, onClick }: Props) => { | |||||
| layoutId={layoutId} | layoutId={layoutId} | ||||
| className={cn ('w-full h-full overflow-hidden rounded-xl shadow', | className={cn ('w-full h-full overflow-hidden rounded-xl shadow', | ||||
| 'transform-gpu will-change-transform', | '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 }} | whileHover={{ scale: 1.02 }} | ||||
| onLayoutAnimationStart={() => { | onLayoutAnimationStart={() => { | ||||
| if (!(cardRef.current)) | if (!(cardRef.current)) | ||||
| @@ -253,7 +253,7 @@ export default (() => { | |||||
| .filter (t => t.slice (0, 5) !== 'nico:') | .filter (t => t.slice (0, 5) !== 'nico:') | ||||
| .join (' '), | .join (' '), | ||||
| parent_post_ids: | parent_post_ids: | ||||
| change.parentPosts | |||||
| (change.parentPosts ?? []) | |||||
| .filter (p => p.type !== 'removed') | .filter (p => p.type !== 'removed') | ||||
| .map (p => p.id) | .map (p => p.id) | ||||
| .join (' '), | .join (' '), | ||||