Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit0e1e419

Browse files
committed
feat(UserPage): add previewer for starred/favroted contents
1 parentef3ce45 commit0e1e419

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

‎containers/UserFavorited/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ class UserFavoritesContainer extends React.Component {
5656
data={pagedData}
5757
thread={curThread}
5858
curView={curView}
59-
onPageChange={debug}
6059
emptyPrefix={`未找到${viewingUser.nickname} 收藏的`}
60+
onPageChange={logic.reload}
61+
onTitleSelect={logic.onTitleSelect}
6162
/>
6263
</React.Fragment>
6364
)}

‎containers/UserFavorited/logic.js‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
//import R from 'ramda'
1+
importRfrom'ramda'
22

33
import{
44
makeDebugger,
5+
dispatchEvent,
56
$solver,
67
asyncRes,
78
TYPE,
89
pagedFilter,
910
THREAD,
11+
EVENT,
1012
}from'../../utils'
1113
importSR71from'../../utils/network/sr71'
1214

@@ -83,6 +85,16 @@ export const changeFavoriteThread = curThread => {
8385
reload()
8486
}
8587

88+
exportfunctiononTitleSelect(data){
89+
const{curThread:thread}=store
90+
91+
dispatchEvent(EVENT.PREVIEW_OPEN,{
92+
type:TYPE[`PREVIEW_${R.toUpper(thread)}_VIEW`],
93+
thread,
94+
data,
95+
})
96+
}
97+
8698
// ###############################
8799
// Data & Error handlers
88100
// ###############################

‎containers/UserStared/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ class UserStaredContainer extends React.Component {
4444
data={pagedData}
4545
thread={curThread}
4646
curView={curView}
47-
onPageChange={logic.reload}
4847
emptyPrefix={`未找到${viewingUser.nickname} 喜欢的`}
48+
onPageChange={logic.reload}
49+
onTitleSelect={logic.onTitleSelect}
4950
/>
5051
</React.Fragment>
5152
)

‎containers/UserStared/logic.js‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
//import R from 'ramda'
1+
importRfrom'ramda'
22

33
import{
44
makeDebugger,
5+
dispatchEvent,
56
$solver,
67
asyncRes,
78
asyncErr,
89
ERR,
910
TYPE,
11+
EVENT,
1012
THREAD,
1113
pagedFilter,
1214
}from'../../utils'
@@ -67,6 +69,16 @@ export function onThreadChange(curThread) {
6769
reload()
6870
}
6971

72+
exportfunctiononTitleSelect(data){
73+
const{curThread:thread}=store
74+
75+
dispatchEvent(EVENT.PREVIEW_OPEN,{
76+
type:TYPE[`PREVIEW_${R.toUpper(thread)}_VIEW`],
77+
thread,
78+
data,
79+
})
80+
}
81+
7082
// ###############################
7183
// Data & Error handlers
7284
// ###############################

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp