Thanks to visit codestin.com
Credit goes to github.com

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

Commit 4e55057

Browse files
authored
chore: reduce bundle size (#1371)
* chore(build): rm un-used thread * chore(version): bump to 1.0.6
1 parent 8f4d40a commit 4e55057

File tree

4 files changed

+24
-40
lines changed

4 files changed

+24
-40
lines changed

deploy/production/web.tar.gz

-58 Bytes
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.5",
3+
"version": "1.0.6",
44
"license": "Apache License 2.0",
55
"scripts": {
66
"dev": "cross-env NODE_ENV=dev next dev",

src/containers/content/CommunityContent/ThreadContent.tsx

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,43 @@
11
import { FC, memo } from 'react'
2+
import dynamic from 'next/dynamic'
23

34
import type { TThread } from '@/spec'
45
import { THREAD } from '@/constant'
56

7+
import { LavaLampLoading } from '@/widgets/Loading'
8+
69
import ArticlesThread from '@/containers//thread/ArticlesThread'
710
import KanbanThread from '@/containers//thread/KanbanThread'
811
import ChangeThread from '@/containers//thread/ChangelogThread'
912
// import ReposThread from '@/containers/thread/ReposThread'
10-
import CperMapThread from '@/containers/thread/CperMapThread'
13+
// import CperMapThread from '@/containers/thread/CperMapThread'
14+
// import WipThread from './WipThread'
1115
import AboutThread from '@/containers/thread/AboutThread'
1216
import HelpThread from '@/containers/thread/HelpThread'
13-
import DashboardThread from '@/containers/thread/DashboardThread'
17+
// import DashboardThread from '@/containers/thread/DashboardThread'
1418

15-
import WipThread from './WipThread'
19+
const DashboardThread = dynamic(
20+
() => import('@/containers/thread/DashboardThread'),
21+
{
22+
/* eslint-disable react/display-name */
23+
loading: () => <LavaLampLoading />,
24+
ssr: false,
25+
},
26+
)
1627

1728
type TProps = {
1829
thread: TThread
1930
}
2031

2132
const ThreadContent: FC<TProps> = ({ thread }) => {
2233
switch (thread) {
23-
case THREAD.INTERVIEW: {
24-
return <WipThread title="开发者访谈" />
25-
}
26-
27-
case THREAD.TEAM: {
28-
return <WipThread title="团队" />
29-
}
34+
// case THREAD.CPER: {
35+
// return <CperMapThread />
36+
// }
3037

31-
case THREAD.PRODUCT: {
32-
return <WipThread title="作品展示" />
33-
}
34-
35-
case THREAD.GUIDE: {
36-
return <WipThread title="酷导航" />
37-
}
38-
39-
case THREAD.ACCOUNT: {
40-
return <WipThread title="违规账户信息" />
41-
}
42-
43-
case THREAD.CPER: {
44-
return <CperMapThread />
45-
}
46-
47-
case THREAD.MAP: {
48-
return <CperMapThread />
49-
}
38+
// case THREAD.MAP: {
39+
// return <CperMapThread />
40+
// }
5041

5142
case THREAD.ABOUT: {
5243
return <AboutThread />

src/containers/digest/CommunityDigest/SimpleLayout/CommunityBrief.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { contains } from 'ramda'
33

44
import type { TCommunity } from '@/spec'
55
import { ICON_CMD } from '@/config'
6-
import { HCN, NON_FILL_COMMUNITY } from '@/constant'
6+
import { NON_FILL_COMMUNITY } from '@/constant'
77

8-
import CommunityJoinSign from '@/widgets/CommunityJoinSign'
8+
// import CommunityJoinSign from '@/widgets/CommunityJoinSign'
99

1010
import {
1111
Wrapper,
@@ -17,7 +17,7 @@ import {
1717
TitleText,
1818
LogoHolder,
1919
} from '../styles/simple_layout/community_brief'
20-
import { subscribeCommunity, unsubscribeCommunity } from '../logic'
20+
// import { subscribeCommunity, unsubscribeCommunity } from '../logic'
2121

2222
const CommunityLogoHolder = `${ICON_CMD}/community_logo_holder.svg`
2323

@@ -43,13 +43,6 @@ const CommunityBrief: FC<TProps> = ({ community }) => {
4343
<TitleWrapper>
4444
<Title>
4545
<TitleText>{community.title}</TitleText>
46-
{community.raw !== HCN && (
47-
<CommunityJoinSign
48-
onFollow={() => subscribeCommunity(community.id)}
49-
onUndoFollow={() => unsubscribeCommunity(community.id)}
50-
hasFollowed={community.viewerHasSubscribed}
51-
/>
52-
)}
5346
</Title>
5447
</TitleWrapper>
5548
</CommunityInfo>

0 commit comments

Comments
 (0)