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

Commit 6312c17

Browse files
committed
fix(route): home page navi fails
1 parent 072c121 commit 6312c17

File tree

7 files changed

+36
-29
lines changed

7 files changed

+36
-29
lines changed

config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.87",
62+
"BUILD_VERSION": "v2.0.88",
6363
"// 1000 * 60 * 10 = 10 mins": "",
6464
"SSR_CACHE_TIME": 60000
6565
}

deploy/production/web.tar.gz

64 Bytes
Binary file not shown.

src/widgets/Navigator/MorePanel/MobileView.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { FC, memo } from 'react'
2-
import Link from 'next/link'
32

43
import { ICON, ICON_CMD } from '@/config'
4+
55
import { ROUTE } from '@/constant'
6+
import { changeToCommunity } from '@/utils/helper'
67

78
import {
89
Wrapper,
@@ -17,49 +18,49 @@ const items = [
1718
{
1819
icon: `${ICON}/menu/shop.svg`,
1920
title: '作品集市',
20-
href: `/${ROUTE.PLAZA}`,
21+
target: ROUTE.PLAZA,
2122
raw: 11,
2223
},
2324
{
2425
icon: `${ICON}/route/cool-guide.svg`,
2526
title: '酷导航',
26-
href: `/${ROUTE.COOL_GUIDE}`,
27+
target: ROUTE.COOL_GUIDE,
2728
raw: 12,
2829
},
2930
{
3031
icon: `${ICON}/route/cup.svg`,
3132
title: '来一杯',
32-
href: `/${ROUTE.HAVE_A_DRINK}`,
33+
target: ROUTE.HAVE_A_DRINK,
3334
raw: 14,
3435
},
3536
{
3637
icon: `${ICON}/route/meetup.svg`,
3738
title: '小聚',
38-
href: `/${ROUTE.MEETUPS}`,
39+
target: ROUTE.MEETUPS,
3940
raw: 15,
4041
},
4142
{
4243
icon: `${ICON_CMD}/header/more_data.svg`,
4344
title: 'Trending',
44-
href: `/${ROUTE.TRENDING}`,
45+
target: ROUTE.TRENDING,
4546
raw: 8,
4647
},
4748
{
4849
icon: `${ICON}/menu/makers2.svg`,
4950
title: 'Makers',
50-
href: '/makers',
51+
target: 'markers',
5152
raw: 2,
5253
},
5354
{
5455
icon: `${ICON}/menu/vip.svg`,
5556
title: '会员',
56-
href: `/${ROUTE.MEMBERSHIP}`,
57+
target: ROUTE.MEMBERSHIP,
5758
raw: 28,
5859
},
5960
{
6061
icon: `${ICON}/menu/ear.svg`,
6162
title: '建议反馈',
62-
href: '/feedback',
63+
target: 'feedback',
6364
raw: 30,
6465
},
6566
]
@@ -69,14 +70,17 @@ const MoreContent: FC = () => {
6970
<Wrapper mobile>
7071
<BodyWrapper>
7172
{items.map((item, index) => (
72-
<Link key={item.href} href={item.href} passHref>
73-
<Entry index={index} mobile>
74-
<Logo src={item.icon} />
75-
<Intro>
76-
<Title>{item.title}</Title>
77-
</Intro>
78-
</Entry>
79-
</Link>
73+
<Entry
74+
key={item.target}
75+
index={index}
76+
mobile
77+
onClick={() => changeToCommunity(item.target)}
78+
>
79+
<Logo src={item.icon} />
80+
<Intro>
81+
<Title>{item.title}</Title>
82+
</Intro>
83+
</Entry>
8084
))}
8185
</BodyWrapper>
8286
</Wrapper>

src/widgets/PostItem/DesktopView/Body.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Link from 'next/link'
55

66
import type { TCommunity, TPost } from '@/spec'
77
import { EVENT } from '@/constant'
8-
import { send } from '@/utils/helper'
8+
import { send, changeToCommunity } from '@/utils/helper'
99

1010
import { SpaceGrow } from '@/widgets/Common'
1111
import DigestSentence from '@/widgets/DigestSentence'
@@ -50,9 +50,11 @@ const Body: FC<TProps> = ({ item, curCommunity }) => {
5050
placement="bottom-start"
5151
delay={1500}
5252
>
53-
<Link href={`/${originalCommunity.raw}`} passHref>
54-
<CommunityLabel>{originalCommunity.title}</CommunityLabel>
55-
</Link>
53+
<CommunityLabel
54+
onClick={() => changeToCommunity(originalCommunity.raw)}
55+
>
56+
{originalCommunity.title}
57+
</CommunityLabel>
5658
</Tooltip>
5759
<LabelDivider />
5860
</Fragment>

src/widgets/PostItem/MobileView/Footer.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { FC } from 'react'
22

33
import type { TPost, TCommunity } from '@/spec'
4-
import { cutRest } from '@/utils/helper'
4+
import { cutRest, changeToCommunity } from '@/utils/helper'
55
import { ICON_CMD } from '@/config'
6-
import Link from 'next/link'
76

87
import DotDivider from '@/widgets/DotDivider'
98

@@ -30,9 +29,11 @@ const Footer: FC<TProps> = ({ item, curCommunity }) => {
3029
<Wrapper>
3130
<Extra>
3231
{showOriginalCommunity && (
33-
<Link href={`/${originalCommunity.raw}`} passHref>
34-
<CommunityLabel>{originalCommunity.title}</CommunityLabel>
35-
</Link>
32+
<CommunityLabel
33+
onClick={() => changeToCommunity(originalCommunity.raw)}
34+
>
35+
{originalCommunity.title}
36+
</CommunityLabel>
3637
)}
3738

3839
{showOriginalCommunity && <DotDivider radius={3} space={6} />}

src/widgets/PostItem/styles/desktop_view/body.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const LeftPart = styled.div`
2323
${css.flex('align-center')};
2424
`
2525

26-
export const CommunityLabel = styled.a`
26+
export const CommunityLabel = styled.div`
2727
color: inherit;
2828
padding-left: 14px;
2929
position: relative;

src/widgets/PostItem/styles/mobile_view/footer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Img from '@/Img'
77
export const Wrapper = styled.div`
88
margin-top: -10px;
99
`
10-
export const CommunityLabel = styled.a`
10+
export const CommunityLabel = styled.div`
1111
color: inherit;
1212
padding-left: 14px;
1313
position: relative;

0 commit comments

Comments
 (0)