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.

Commit285243b

Browse files
authored
chore: home page alert (#1370)
* feat: add alert text & adjust home page* chore(version): bump to 1.0.5
1 parent8107442 commit285243b

File tree

4 files changed

+14
-74
lines changed

4 files changed

+14
-74
lines changed

‎deploy/production/web.tar.gz‎

-30.3 KB
Binary file not shown.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"coderplanets_web",
3-
"version":"1.0.4",
3+
"version":"1.0.5",
44
"license":"Apache License 2.0",
55
"scripts": {
66
"dev":"cross-env NODE_ENV=dev next dev",

‎src/pages/index.tsx‎

Lines changed: 5 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,87 +2,22 @@
22
this page is for /explore
33
*/
44
import{Provider}from'mobx-react'
5-
import{clone}from'ramda'
65
import{METRIC}from'@/constant'
76

8-
import{PAGE_SIZE}from'@/config'
9-
import{
10-
ssrBaseStates,
11-
ssrFetchPrepare,
12-
ssrGetParam,
13-
refreshIfneed,
14-
exploreSEO,
15-
ssrError,
16-
}from'@/utils'
7+
import{exploreSEO}from'@/utils'
178

189
import{useStore}from'@/stores/init'
1910

2011
importGlobalLayoutfrom'@/containers/layout/GlobalLayout'
2112
importExploreContentfrom'@/containers/content/ExploreContent'
2213

23-
import{P}from'@/schemas'
24-
25-
constloader=async(context,opt={})=>{
26-
const{ gqClient, userHasLogin}=ssrFetchPrepare(context,opt)
27-
28-
constcategory=ssrGetParam(context,'nc_path')
29-
constpage=ssrGetParam(context,'page')
30-
31-
constfilter={
32-
page:1,
33-
size:PAGE_SIZE.M,
34-
}
35-
36-
constcommunitiesFilter=clone(filter)
37-
//@ts-ignore
38-
if(category)communitiesFilter.category=category
39-
if(page)communitiesFilter.page=parseInt(page,10)
40-
41-
constsessionState=gqClient.request(P.sessionState)
42-
constpagedCommunities=gqClient.request(P.pagedCommunities,{
43-
filter:communitiesFilter,
44-
userHasLogin,
45-
})
46-
constpagedCategories=gqClient.request(P.pagedCategories,{ filter})
47-
48-
constsubscribedCommunities=gqClient.request(P.subscribedCommunities,{
49-
filter:{
50-
page:1,
51-
size:30,
52-
},
53-
})
54-
55-
return{
56-
...(awaitsessionState),
57-
...(awaitpagedCategories),
58-
...(awaitpagedCommunities),
59-
...(awaitsubscribedCommunities),
60-
}
61-
}
62-
6314
exportconstgetServerSideProps=async(context)=>{
64-
letresp
65-
try{
66-
resp=awaitloader(context)
67-
const{ sessionState}=resp
68-
69-
refreshIfneed(sessionState,'/explore',context)
70-
}catch(e){
71-
console.log('#### error from server: ',e)
72-
returnssrError(context,'fetch',500)
73-
}
74-
75-
const{ pagedCategories, pagedCommunities}=resp
76-
77-
constinitProps={
78-
...ssrBaseStates(resp),
79-
exploreContent:{
80-
pagedCommunities,
81-
pagedCategories,
15+
return{
16+
redirect:{
17+
permanent:false,
18+
destination:'/home',
8219
},
8320
}
84-
85-
return{props:{errorCode:null, ...initProps}}
8621
}
8722

8823
constExplorePage=(props)=>{

‎src/widgets/BannerNotify/index.tsx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ type TProps = {
3232
bg:TColorName
3333
}
3434

35+
constDETAIL_TEXT=
36+
'本站即将迁移到 Groupher.com, 为中小产品团队提供社区反馈服务,如果你对此有兴趣,欢迎加 v(mydearxym) 详聊。'
37+
3538
constBannerNotify:FC<TProps>=({
3639
testid='banner-notify',
3740
metric,
@@ -46,18 +49,20 @@ const BannerNotify: FC<TProps> = ({
4649
>
4750
<Row>
4851
<NotifyIcon/>
49-
<Desc>我们将在 10 月发布新的版本,敬请期待</Desc>
52+
<Desc>网站改版迁移中,服务暂不可用</Desc>
5053
</Row>
5154

5255
<Row>
5356
{layout===BANNER_NOTIFY_LAYOUT.DEFAULT ?(
5457
<Fragment>
55-
<LinkBtnbg={bg}>查看详情</LinkBtn>
58+
<LinkBtnonClick={()=>alert(DETAIL_TEXT)}bg={bg}>
59+
查看详情
60+
</LinkBtn>
5661
<CrossIcon/>
5762
</Fragment>
5863
) :(
5964
<Fragment>
60-
<LinkText>查看详情</LinkText>
65+
<LinkTextonClick={()=>alert(DETAIL_TEXT)}>查看详情</LinkText>
6166
<ArrowIcon/>
6267
</Fragment>
6368
)}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp