1
- import { useContext , useEffect , useRef , useState } from "react" ;
2
- import { Helmet } from "react-helmet" ;
3
- import { useTranslation } from "react-i18next" ;
1
+ import { useContext , useEffect , useRef , useState } from "react" ;
2
+ import { Helmet } from "react-helmet" ;
3
+ import { useTranslation } from "react-i18next" ;
4
4
import ReactModal from "react-modal" ;
5
5
import Popup from "reactjs-popup" ;
6
- import { Link , useLocation } from "wouter" ;
7
- import { useAlert , useConfirm } from "../components/dialog" ;
8
- import { HashTag } from "../components/hashtag" ;
9
- import { Waiting } from "../components/loading" ;
10
- import { Markdown } from "../components/markdown" ;
11
- import { client } from "../main" ;
12
- import { ClientConfigContext } from "../state/config" ;
13
- import { ProfileContext } from "../state/profile" ;
14
- import { headersWithAuth } from "../utils/auth" ;
15
- import { siteName } from "../utils/constants" ;
16
- import { timeago } from "../utils/timeago" ;
17
- import { Button } from "../components/button" ;
18
- import { Tips } from "../components/tips" ;
19
- import { useLoginModal } from "../hooks/useLoginModal" ;
6
+ import { Link , useLocation } from "wouter" ;
7
+ import { useAlert , useConfirm } from "../components/dialog" ;
8
+ import { HashTag } from "../components/hashtag" ;
9
+ import { Waiting } from "../components/loading" ;
10
+ import { Markdown } from "../components/markdown" ;
11
+ import { client } from "../main" ;
12
+ import { ClientConfigContext } from "../state/config" ;
13
+ import { ProfileContext } from "../state/profile" ;
14
+ import { headersWithAuth } from "../utils/auth" ;
15
+ import { siteName } from "../utils/constants" ;
16
+ import { timeago } from "../utils/timeago" ;
17
+ import { Button } from "../components/button" ;
18
+ import { Tips } from "../components/tips" ;
19
+ import { useLoginModal } from "../hooks/useLoginModal" ;
20
20
import mermaid from "mermaid" ;
21
+ import { AdjacentSection } from "../components/adjacent_feed.tsx" ;
21
22
22
23
type Feed = {
23
24
id : number ;
@@ -39,14 +40,16 @@ type Feed = {
39
40
uv : number ;
40
41
} ;
41
42
43
+
44
+
42
45
export function FeedPage ( { id, TOC , clean } : { id : string , TOC : ( ) => JSX . Element , clean : ( id : string ) => void } ) {
43
46
const { t } = useTranslation ( ) ;
44
47
const profile = useContext ( ProfileContext ) ;
45
48
const [ feed , setFeed ] = useState < Feed > ( ) ;
46
49
const [ error , setError ] = useState < string > ( ) ;
47
50
const [ headImage , setHeadImage ] = useState < string > ( ) ;
48
51
const ref = useRef ( "" ) ;
49
- const [ _ , setLocation ] = useLocation ( ) ;
52
+ const [ , setLocation ] = useLocation ( ) ;
50
53
const { showAlert, AlertUI } = useAlert ( ) ;
51
54
const { showConfirm, ConfirmUI } = useConfirm ( ) ;
52
55
const [ top , setTop ] = useState < number > ( 0 ) ;
@@ -296,6 +299,7 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen
296
299
</ div >
297
300
</ div >
298
301
</ article >
302
+ < AdjacentSection id = { id } setError = { setError } />
299
303
{ feed && < Comments id = { `${ feed . id } ` } /> }
300
304
< div className = "h-16" />
301
305
</ main >
0 commit comments