Skip to content

Commit 5b926e3

Browse files
committed
fix: tooltip
Signed-off-by: Innei <[email protected]>
1 parent 9e80d70 commit 5b926e3

File tree

7 files changed

+30
-8
lines changed

7 files changed

+30
-8
lines changed

src/app/(page-detail)/[slug]/layout.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ export default async (props: NextPageParams<PageParams>) => {
111111
</BottomToUpTransitionView>
112112
</article>
113113

114-
<PagePaginator />
114+
<BottomToUpSoftScaleTransitionView delay={1000}>
115+
<PagePaginator />
116+
</BottomToUpSoftScaleTransitionView>
115117
</div>
116118
</PageLoading>
117119

src/app/notes/[id]/Transtion.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
'use client'
2+
3+
import { createTransitionView } from '~/components/ui/transition/factor'
4+
5+
export const Transition = createTransitionView({
6+
from: {
7+
translateY: 80,
8+
opacity: 0.001,
9+
},
10+
to: {
11+
translateY: 0,
12+
opacity: 1,
13+
},
14+
preset: {
15+
type: 'spring',
16+
damping: 20,
17+
stiffness: 200,
18+
},
19+
})

src/app/notes/[id]/layout.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Metadata } from 'next'
33

44
import { NotSupport } from '~/components/common/NotSupport'
55
import { BottomToUpSoftScaleTransitionView } from '~/components/ui/transition/BottomToUpSoftScaleTransitionView'
6-
import { BottomToUpTransitionView } from '~/components/ui/transition/BottomToUpTransitionView'
76
import { OnlyMobile } from '~/components/ui/viewport/OnlyMobile'
87
import { CommentAreaRoot } from '~/components/widgets/comment'
98
import { NoteMainContainer } from '~/components/widgets/note/NoteMainContainer'
@@ -20,6 +19,7 @@ import { CurrentNoteIdProvider } from '~/providers/note/CurrentNoteIdProvider'
2019
import { queries } from '~/queries/definition'
2120

2221
import { Paper } from '../Paper'
22+
import { Transition } from './Transtion'
2323

2424
export const generateMetadata = async ({
2525
params,
@@ -89,7 +89,7 @@ export default async (
8989
<CurrentNoteDataProvider data={data} />
9090
<SyncNoteDataAfterLoggedIn />
9191

92-
<BottomToUpTransitionView className="min-w-0">
92+
<Transition className="min-w-0">
9393
<Paper as={NoteMainContainer}>{props.children}</Paper>
9494
<BottomToUpSoftScaleTransitionView delay={500}>
9595
{isCN ? (
@@ -98,7 +98,7 @@ export default async (
9898
<CommentAreaRoot refId={noteObjectId} allowComment={allowComment} />
9999
)}
100100
</BottomToUpSoftScaleTransitionView>
101-
</BottomToUpTransitionView>
101+
</Transition>
102102

103103
<OnlyMobile>
104104
<TocFAB />

src/app/notes/[id]/page.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ const SubscribeBell = dynamic(() =>
5353
(mod) => mod.SubscribeBell,
5454
),
5555
)
56-
const TocAside = dynamic(() =>
57-
import('~/components/widgets/toc').then((mod) => mod.TocAside),
58-
)
5956

6057
const PageImpl = () => {
6158
return (

src/components/layout/header/internal/Activity.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export function Activity() {
8989
TriggerComponent={TriggerComponent}
9090
triggerComponentProps={cMusicProps}
9191
type="tooltip"
92+
strategy="fixed"
9293
>
9394
{ownerName} 正在听 {media.title} - {media.artist}
9495
</FloatPopover>
@@ -112,6 +113,7 @@ export function Activity() {
112113
TriggerComponent={TriggerComponent}
113114
triggerComponentProps={memoProcessName}
114115
type="tooltip"
116+
strategy="fixed"
115117
>
116118
{ownerName} 正在使用 {processName}
117119
</FloatPopover>

src/components/ui/float-popover/FloatPopover.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export function FloatPopover<T extends {}>(
243243
headless && styles['headless'],
244244
animate && styles['animate'],
245245
type === 'tooltip'
246-
? `max-w-[25rem] break-all rounded-xl bg-base-100 px-4 py-2 ${styles['headless']}`
246+
? `max-w-[25rem] break-all rounded-xl px-4 py-2 ${styles['headless']}`
247247
: styles['popover-root'],
248248
popoverClassNames,
249249
)}

src/components/ui/transition/factor.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client'
2+
13
import { memo } from 'react'
24
import { m } from 'framer-motion'
35
import type {

0 commit comments

Comments
 (0)