Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit e7ff6ca

Browse files
committed
fix(mobile): some ux detail, bump to v2.0.90
1 parent 9553f1e commit e7ff6ca

File tree

11 files changed

+69
-52
lines changed

11 files changed

+69
-52
lines changed

config/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"ICON_CMD": "https://assets.coderplanets.com/icons/cmd",
4949
"DEFAULT_ICON": "https://assets.coderplanets.com/icons/cmd/cheatsheet.svg",
5050
"DEFAULT_USER_AVATAR": "https://assets.coderplanets.com/icons/cmd/alien_user3.svg",
51-
"GRAPHQL_ENDPOINT": "https://api.coderplanets.com/graphiql",
51+
"GRAPHQL_ENDPOINT": "http://localhost:4001/graphiql",
5252
"SITE_URL": "https://coderplanets.com",
5353
"SITE_URL_SHORT": "https://coderplanets.com",
5454
"GITHUB": "https://github.com/coderplanets",
@@ -59,7 +59,7 @@
5959
"//--- contact configs ---//": "",
6060
"EMAIL_SUPPORT": "coderplanets@outlook.com",
6161
"// GRAPHQL_ENDPOINT": "https://api.coderplanets.com/graphiql",
62-
"BUILD_VERSION": "v2.0.89",
62+
"BUILD_VERSION": "v2.0.90",
6363
"// 1000 * 60 * 10 = 10 mins": "",
6464
"SSR_CACHE_TIME": 60000
6565
}

deploy/production/web.tar.gz

253 Bytes
Binary file not shown.

src/containers/content/MembershipContent/store.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ const MembershipContent = T.model('MembershipContent', {
3939
{
4040
pkgType: PACKAGE.ADVANCE,
4141
desc: '更好更全面的阅读、交互体验。更丰富的交流工具',
42-
yearlyPrice: '19.9',
43-
monthlyPrice: '0.99',
42+
yearlyPrice: '1',
43+
monthlyPrice: '0.1',
4444
illustration: PACKAGE.ADVANCE,
4545
serviceItems: [
4646
{ title: '主题设置' },
@@ -57,11 +57,11 @@ const MembershipContent = T.model('MembershipContent', {
5757
},
5858
{
5959
pkgType: PACKAGE.GIRL,
60-
desc: '女生福利,高级会员的所有服务。',
61-
yearlyPrice: '19.9',
62-
monthlyPrice: '0.99',
60+
desc: '支持性别平权,鼓励更多女性加入开发者群体。',
61+
yearlyPrice: '1',
62+
monthlyPrice: '0.1',
6363
illustration: PACKAGE.GIRL,
64-
serviceItems: [{ title: '头像标识(可选)' }],
64+
serviceItems: [{ title: '头像标识(可选)' }],
6565
},
6666
{
6767
pkgType: PACKAGE.TEAM,

src/containers/digest/CommunityDigest/logic.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ const DataSolver = [
7979
action: ({ community }) => {
8080
markLoading(false)
8181
const { subPath } = store.curRoute
82-
log('community: ', community)
8382
const activeThread = singular(subPath) || ARTICLE_THREAD.POST
8483
store.setViewing({ community, activeThread })
8584
},
@@ -100,7 +99,9 @@ const DataSolver = [
10099
},
101100
{
102101
match: asyncRes(EVENT.COMMUNITY_CHANGE),
103-
action: () => loadCommunity(),
102+
action: () => {
103+
loadCommunity()
104+
},
104105
},
105106
]
106107
const ErrSolver = [

src/containers/unit/Footer/DesktopView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { FC } from 'react'
88
import { includes } from 'ramda'
99
// import dynamic from 'next/dynamic'
1010

11+
import type { TMetric } from '@/spec'
1112
import { buildLog } from '@/utils/logger'
1213
import { pluggedIn } from '@/utils/mobx'
13-
import type { TMetric } from '@/spec'
1414
import { HCN, METRIC } from '@/constant'
1515

1616
import JoinModal from '@/containers/tool/JoinModal'
Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { FC, memo } from 'react'
1+
import { FC } from 'react'
22

33
import Link from 'next/link'
44

5+
import type { TMetric } from '@/spec'
56
import { ICON, GITHUB, BUILD_VERSION, ABOUT_LINK } from '@/config'
7+
import { pluggedIn } from '@/utils/mobx'
68
import { ROUTE } from '@/constant'
79

10+
import type { TStore } from '../store'
811
import {
912
Wrapper,
1013
SiteWrapper,
@@ -16,37 +19,47 @@ import {
1619
Divider,
1720
VersionWrapper,
1821
} from '../styles/mobile_view'
22+
import { useInit } from '../logic'
1923

20-
const MobileView: FC = () => (
21-
<Wrapper>
22-
<SiteWrapper>
23-
<Logo />
24-
<SiteTitle>oderPlanets</SiteTitle>
25-
</SiteWrapper>
26-
27-
<SiteInfoWrapper>
28-
<Link href={`${ABOUT_LINK}`} passHref>
29-
<Item>关于</Item>
30-
</Link>
31-
<Divider space={8} radius={3} />
32-
<Link href="/feedback" passHref>
33-
<Item>建议反馈</Item>
34-
</Link>
35-
<Divider space={8} radius={3} />
36-
<Link href={`/${ROUTE.SPONSOR}`} passHref>
37-
<Item>
38-
特别感谢 <ItemIcon src={`${ICON}/emotion/heart.png`} />
39-
</Item>
40-
</Link>
41-
<Divider space={8} radius={3} />
42-
<Link href={GITHUB} passHref>
43-
<Item target="_blank">Github</Item>
44-
</Link>
45-
</SiteInfoWrapper>
46-
<VersionWrapper>
47-
<Item>{BUILD_VERSION}</Item>
48-
</VersionWrapper>
49-
</Wrapper>
50-
)
51-
52-
export default memo(MobileView)
24+
type TProps = {
25+
footer?: TStore
26+
metric?: TMetric
27+
}
28+
29+
const FooterContainer: FC<TProps> = ({ footer: store, metric }) => {
30+
useInit(store, metric)
31+
32+
return (
33+
<Wrapper>
34+
<SiteWrapper>
35+
<Logo />
36+
<SiteTitle>oderPlanets</SiteTitle>
37+
</SiteWrapper>
38+
39+
<SiteInfoWrapper>
40+
<Link href={`${ABOUT_LINK}`} passHref>
41+
<Item>关于</Item>
42+
</Link>
43+
<Divider space={8} radius={3} />
44+
<Link href="/feedback" passHref>
45+
<Item>建议反馈</Item>
46+
</Link>
47+
<Divider space={8} radius={3} />
48+
<Link href={`/${ROUTE.SPONSOR}`} passHref>
49+
<Item>
50+
特别感谢 <ItemIcon src={`${ICON}/emotion/heart.png`} />
51+
</Item>
52+
</Link>
53+
<Divider space={8} radius={3} />
54+
<Link href={GITHUB} passHref>
55+
<Item target="_blank">Github</Item>
56+
</Link>
57+
</SiteInfoWrapper>
58+
<VersionWrapper>
59+
<Item>{BUILD_VERSION}</Item>
60+
</VersionWrapper>
61+
</Wrapper>
62+
)
63+
}
64+
65+
export default pluggedIn(FooterContainer) as FC

src/containers/unit/Footer/logic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const DataSolver = [
102102
match: asyncRes(EVENT.COMMUNITY_CHANGE_BEFORE),
103103
action: (data): void => {
104104
const { path } = data[EVENT.COMMUNITY_CHANGE_BEFORE]
105+
send(EVENT.DRAWER.CLOSE)
105106
store.changeCommunity(path)
106107
send(EVENT.COMMUNITY_CHANGE)
107108
},
@@ -121,6 +122,7 @@ export const useInit = (_store: TStore, metric: TMetric): void => {
121122
checkSessionState()
122123

123124
return () => {
125+
if (!sub$) return
124126
sub$.unsubscribe()
125127
}
126128
}, [_store, metric])

src/containers/unit/ModeLineMenu/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ const ModeLineMenuContainer: FC<TProps> = ({
8383
useInit(store)
8484
const { curActive, subscribedCommunities } = store
8585

86-
console.log('# type: ', type)
87-
8886
return (
8987
<Wrapper testid={testid}>
9088
{renderMenus(type, curActive, subscribedCommunities)}

src/widgets/Navigator/MorePanel/MobileView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ const MoreContent: FC = () => {
7474
key={item.target}
7575
index={index}
7676
mobile
77-
onClick={() => changeToCommunity(item.target)}
77+
onClick={() => {
78+
changeToCommunity(item.target)
79+
}}
7880
>
7981
<Logo src={item.icon} />
8082
<Intro>

utils/helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ export const changeToCommunity = (raw = ''): void => {
277277
const curPath = pathname.slice(1)
278278
const isNonCommunityPage = includes(curPath, values(NON_COMMUNITY_ROUTE))
279279
const isArticlePage = includes(curPath.split('/')[0], values(ARTICLE_THREAD))
280+
const isTargetNonCommunityPage = includes(raw, values(NON_COMMUNITY_ROUTE))
280281

281-
if (isNonCommunityPage || isArticlePage) {
282+
if (isNonCommunityPage || isArticlePage || isTargetNonCommunityPage) {
282283
const target = raw === HCN ? '' : raw
283284
Router.push(`/${target}`)
284285
return

0 commit comments

Comments
 (0)