This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +29
-18
lines changed Expand file tree Collapse file tree 4 files changed +29
-18
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ import { SwissArmyKnife } from './helper/swissArmyKnife'
2525import githubLoginHandler from './oauth/github_handler'
2626
2727const debug = makeDebugger ( 'L:Doraemon' )
28- const sr71$ = new SR71 ( )
28+ const sr71$ = new SR71 ( {
29+ resv_event : [ EVENT . QUERY_DORAMON ] ,
30+ } )
2931
3032let sub$ = null
3133let store = null
@@ -428,6 +430,15 @@ const DataSolver = [
428430 convert2Sugguestions ( data , totalCount )
429431 } ,
430432 } ,
433+ {
434+ match : asyncRes ( EVENT . QUERY_DORAMON ) ,
435+ action : res => {
436+ const { data } = res [ EVENT . QUERY_DORAMON ]
437+ store . open ( )
438+ store . markState ( { inputValue : data } )
439+ queryPocket ( )
440+ } ,
441+ } ,
431442]
432443
433444const ErrSolver = [
Original file line number Diff line number Diff line change @@ -13,30 +13,18 @@ import {
1313 ThxTitle ,
1414} from './styles/mobile_bottom_info'
1515
16- import { toggleBusBanner } from './logic'
16+ import { toggleBusBanner , openDoraemon } from './logic'
1717
1818const MobileBottomInfo = ( ) => (
1919 < React . Fragment >
2020 < LinkInfoWrapper >
21- < ItemBtn href = "/communities" rel = "noopener noreferrer" target = "_blank ">
21+ < ItemBtn as = "a" href = "/communities" rel = "noopener noreferrer" >
2222 所有社区
2323 </ ItemBtn >
2424 < DotDivider radius = "4px" />
25- < ItemBtn href = "/communities" rel = "noopener noreferrer" target = "_blank" >
26- 我的关注
27- </ ItemBtn >
28- < DotDivider radius = "4px" />
29- < ItemBtn
30- href = { `${ GITHUB_WEB_ADDR } ` }
31- rel = "noopener noreferrer"
32- target = "_blank"
33- >
34- 主题
35- </ ItemBtn >
25+ < ItemBtn onClick = { openDoraemon . bind ( this , '/' ) } > 我的关注</ ItemBtn >
3626 < DotDivider radius = "4px" />
37- < ItemBtn href = { `${ ISSUE_ADDR } ` } rel = "noopener noreferrer" target = "_blank" >
38- 打赏
39- </ ItemBtn >
27+ < ItemBtn onClick = { openDoraemon . bind ( this , '/theme/' ) } > 切换主题</ ItemBtn >
4028 </ LinkInfoWrapper >
4129
4230 < SiteInfoWrapper >
Original file line number Diff line number Diff line change 11// import R from 'ramda'
22
3- import { makeDebugger , $solver , PAYMENT_USAGE } from 'utils'
3+ import {
4+ makeDebugger ,
5+ $solver ,
6+ dispatchEvent ,
7+ EVENT ,
8+ PAYMENT_USAGE ,
9+ } from 'utils'
410import SR71 from 'utils/async/sr71'
511
612// import S from './schema'
@@ -27,6 +33,9 @@ export const onPay = num => {
2733 if ( ! store . isLogin ) return store . authWarning ( )
2834 store . cashierHelper ( { paymentUsage : PAYMENT_USAGE . DONATE , amount : num } )
2935}
36+
37+ export const openDoraemon = data => dispatchEvent ( EVENT . QUERY_DORAMON , { data } )
38+
3039// ###############################
3140// Data & Error handlers
3241// ###############################
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ export const EVENT = {
4949 // upload
5050 UPLOAD_IMG_START : 'UPLOAD_IMG_START' ,
5151 UPLOAD_IMG_FINISH : 'UPLOAD_IMG_FINISH' ,
52+
53+ // doramon
54+ QUERY_DORAMON : 'QUERY_DORAMON' ,
5255}
5356
5457export const TYPE = {
You can’t perform that action at this time.
0 commit comments