Reviewed-on: #397 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #397 でマージされました.
このコミットが含まれているのは:
@@ -12,9 +12,12 @@ import { useDialogue } from '@/components/dialogues/DialogueProvider'
|
||||
import MainArea from '@/components/layout/MainArea'
|
||||
import { toast } from '@/components/ui/use-toast'
|
||||
import { SITE_TITLE } from '@/config'
|
||||
import { clientAnimationTransition,
|
||||
clientScrollBehaviour } from '@/lib/clientAnimation'
|
||||
import { fetchPostChanges, updatePost } from '@/lib/posts'
|
||||
import { postsKeys, tagsKeys } from '@/lib/queryKeys'
|
||||
import { fetchTag } from '@/lib/tags'
|
||||
import { useClientBehaviourSettings } from '@/lib/useClientBehaviourSettings'
|
||||
import { cn, dateString, originalCreatedAtString } from '@/lib/utils'
|
||||
|
||||
import type { FC, MouseEvent } from 'react'
|
||||
@@ -37,6 +40,12 @@ const renderDiff = (diff: { current: string | null; prev: string | null }) => (
|
||||
|
||||
const PostHistoryPage: FC = () => {
|
||||
const dialogue = useDialogue ()
|
||||
const behaviourSettings = useClientBehaviourSettings ()
|
||||
const animationMode = behaviourSettings.animation ?? 'normal'
|
||||
const layoutTransition = clientAnimationTransition (
|
||||
animationMode,
|
||||
{ normal: { duration: .2, ease: 'easeOut' as const } },
|
||||
)
|
||||
|
||||
const location = useLocation ()
|
||||
const query = new URLSearchParams (location.search)
|
||||
@@ -113,8 +122,9 @@ const PostHistoryPage: FC = () => {
|
||||
}
|
||||
|
||||
useEffect (() => {
|
||||
document.querySelector ('table')?.scrollIntoView ({ behavior: 'smooth' })
|
||||
}, [location.search])
|
||||
document.querySelector ('table')?.scrollIntoView ({
|
||||
behavior: clientScrollBehaviour (animationMode) })
|
||||
}, [animationMode, location.search])
|
||||
|
||||
const layoutIds: string[] = []
|
||||
|
||||
@@ -198,8 +208,8 @@ const PostHistoryPage: FC = () => {
|
||||
rowSpan={rowsCnt}>
|
||||
<PrefetchLink to={`/posts/${ change.postId }`}>
|
||||
<motion.div
|
||||
layoutId={layoutId}
|
||||
transition={{ layout: { duration: .2, ease: 'easeOut' } }}>
|
||||
layoutId={animationMode === 'off' ? undefined : layoutId}
|
||||
transition={{ layout: layoutTransition }}>
|
||||
<img src={change.thumbnail.current
|
||||
|| change.thumbnailBase.current
|
||||
|| undefined}
|
||||
|
||||
新しい課題から参照
ユーザをブロックする