Skip to content

Commit 44aceca

Browse files
committed
fix: build
Signed-off-by: Innei <[email protected]>
1 parent 3e5fa42 commit 44aceca

File tree

5 files changed

+63
-71
lines changed

5 files changed

+63
-71
lines changed

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

-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
'use client'
22

3-
import { atom } from 'jotai'
43
import { useParams } from 'next/navigation'
5-
import type { NoteModel } from '@mx-space/api-client'
64
import type { UseQueryResult } from '@tanstack/react-query'
75
import type { FC } from 'react'
86

97
import { Loading } from '~/components/ui/loading'
108
import { useNoteByNidQuery } from '~/queries/hooks/useNoteQuery'
119
import { parseMarkdown } from '~/remark'
1210

13-
export const timelineListAtom = atom(
14-
[] as Pick<NoteModel, 'id' | 'title' | 'nid' | 'created'>[],
15-
)
16-
1711
const LoadingComponent = () => <Loading />
1812
const PageDataHolder = (
1913
PageImpl: FC<any>,

src/components/ui/transition/factor.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import type { Target } from 'framer-motion'
1+
import { Fragment } from 'react'
22
import { AnimatePresence, motion } from 'framer-motion'
3+
import type { Target, TargetAndTransition } from 'framer-motion'
34
import type { FC, PropsWithChildren } from 'react'
4-
import { Fragment } from 'react'
5+
import type { BaseTransitionProps } from './typings'
56

67
import { microReboundPreset } from '~/constants/spring'
78

8-
import type { BaseTransitionProps } from './typings'
9-
109
interface TransitionViewParams {
1110
from: Target
1211
to: Target
@@ -76,7 +75,7 @@ export const createTransitionView = (
7675
duration,
7776
...animation.exit,
7877
delay: exit / 1000,
79-
},
78+
} as TargetAndTransition['transition'],
8079
}}
8180
transition={{
8281
duration,

src/components/ui/transition/typings.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type {
22
HTMLMotionProps,
3-
Inertia,
4-
Keyframes,
5-
Spring,
6-
Tween,
73
motion,
4+
TargetAndTransition,
85
} from 'framer-motion'
96

107
export interface BaseTransitionProps extends HTMLMotionProps<'div'> {
@@ -19,8 +16,8 @@ export interface BaseTransitionProps extends HTMLMotionProps<'div'> {
1916
}
2017

2118
animation?: {
22-
enter?: Tween | Spring | Keyframes | Inertia
23-
exit?: Tween | Spring | Keyframes | Inertia
19+
enter?: TargetAndTransition['transition']
20+
exit?: TargetAndTransition['transition']
2421
}
2522
/**
2623
* @default true

src/constants/meta-icon.ts

+51-51
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
import type { FC } from 'react'
2-
import React from 'react'
1+
// import type { FC } from 'react'
2+
// import React from 'react'
33

4-
import {
5-
FaSolidAngry,
6-
FaSolidFlushed,
7-
FaSolidFrownOpen,
8-
FaSolidGrimace,
9-
FaSolidGrinSquintTears,
10-
FaSolidMeh,
11-
FaSolidSadCry,
12-
FaSolidSadTear,
13-
FaSolidSmile,
14-
FaSolidTired,
15-
} from '~/components/ui/Icons/emoji'
16-
import { PhSunBold } from '~/components/ui/Icons/layout'
17-
import {
18-
BiCloudLightningRainFill,
19-
BiCloudRainFill,
20-
MdiCloud,
21-
MdiSnowflake,
22-
RiSunCloudyFill,
23-
} from '~/components/ui/Icons/weather'
4+
// import {
5+
// FaSolidAngry,
6+
// FaSolidFlushed,
7+
// FaSolidFrownOpen,
8+
// FaSolidGrimace,
9+
// FaSolidGrinSquintTears,
10+
// FaSolidMeh,
11+
// FaSolidSadCry,
12+
// FaSolidSadTear,
13+
// FaSolidSmile,
14+
// FaSolidTired,
15+
// } from '~/components/ui/Icons/emoji'
16+
// import { PhSunBold } from '~/components/ui/Icons/layout'
17+
// import {
18+
// BiCloudLightningRainFill,
19+
// BiCloudRainFill,
20+
// MdiCloud,
21+
// MdiSnowflake,
22+
// RiSunCloudyFill,
23+
// } from '~/components/ui/Icons/weather'
2424

25-
export const weather2icon = (weather: string) => {
26-
const map: Record<string, FC> = {
27-
: PhSunBold,
28-
多云: RiSunCloudyFill,
29-
: MdiCloud,
30-
: MdiSnowflake,
31-
: BiCloudRainFill,
32-
雷雨: BiCloudLightningRainFill,
33-
}
34-
return React.createElement(map[weather] || PhSunBold)
35-
}
25+
// export const weather2icon = (weather: string) => {
26+
// const map: Record<string, FC> = {
27+
// 晴:PhSunBold,
28+
// 多云:RiSunCloudyFill,
29+
// 阴:MdiCloud,
30+
// 雪:MdiSnowflake,
31+
// 雨:BiCloudRainFill,
32+
// 雷雨:BiCloudLightningRainFill,
33+
// }
34+
// return React.createElement(map[weather] || PhSunBold)
35+
// }
3636

37-
export const mood2icon = (mood: string) => {
38-
const map: Record<string, FC> = {
39-
开心: FaSolidSmile,
40-
伤心: FaSolidSadTear,
41-
大哭: FaSolidSadCry,
42-
生气: FaSolidAngry,
43-
痛苦: FaSolidTired,
44-
悲哀: FaSolidMeh,
45-
不快: FaSolidMeh,
46-
激动: FaSolidGrinSquintTears,
47-
担心: FaSolidFrownOpen,
48-
可怕: FaSolidGrimace,
49-
可恶: FaSolidAngry,
50-
绝望: FaSolidFrownOpen,
51-
焦虑: FaSolidFlushed,
52-
}
53-
return React.createElement(map[mood] || FaSolidSmile)
54-
}
37+
// export const mood2icon = (mood: string) => {
38+
// const map: Record<string, FC> = {
39+
// 开心:FaSolidSmile,
40+
// 伤心:FaSolidSadTear,
41+
// 大哭:FaSolidSadCry,
42+
// 生气:FaSolidAngry,
43+
// 痛苦:FaSolidTired,
44+
// 悲哀:FaSolidMeh,
45+
// 不快:FaSolidMeh,
46+
// 激动:FaSolidGrinSquintTears,
47+
// 担心:FaSolidFrownOpen,
48+
// 可怕:FaSolidGrimace,
49+
// 可恶:FaSolidAngry,
50+
// 绝望:FaSolidFrownOpen,
51+
// 焦虑:FaSolidFlushed,
52+
// }
53+
// return React.createElement(map[mood] || FaSolidSmile)
54+
// }

src/hooks/common/use-click-away.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @copy https://github.com/streamich/react-use/blob/master/src/useClickAway.ts
2-
import type { RefObject } from 'react'
32
import { useEffect, useRef } from 'react'
3+
import type { RefObject } from 'react'
44

55
function on<T extends Window | Document | HTMLElement | EventTarget>(
66
obj: T | null,
@@ -38,9 +38,11 @@ const useClickAway = <E extends Event = Event>(
3838
savedCallback.current = onClickAway
3939
}, [onClickAway])
4040
useEffect(() => {
41-
const handler = (event) => {
41+
const handler = (event: React.MouseEvent) => {
4242
const { current: el } = ref
43-
el && !el.contains(event.target) && savedCallback.current(event)
43+
el &&
44+
!el.contains(event.target as any) &&
45+
savedCallback.current(event as any)
4446
}
4547
for (const eventName of events) {
4648
on(document, eventName, handler)

0 commit comments

Comments
 (0)