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

Commit 8a6593a

Browse files
authored
refactor: groupher community demo (#1285)
* style(groupher): fake a full thread groupher demo * style(misc): community banner & article headers * style(article-page): asjust pure layout * refactor: adjust roadmap layout * style(kanban-thread): asjust icon & action layout * refactor(roadmap): style & text adjust * style: article navi arrow * feat: simplify the footer * fix(ci): ts build error for dynamic import components
1 parent 322816d commit 8a6593a

File tree

119 files changed

+522
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+522
-428
lines changed

src/containers/content/ArticleContent/DesktopView/ArticleLayout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ import type { TMetric } from '@/spec'
1111
import { buildLog } from '@/utils/logger'
1212
import { bond } from '@/utils/mobx'
1313

14-
import { ArticleFooter, Comments } from '@/containers/dynamic'
14+
// import { Comments } from '@/containers/dynamic'
15+
1516
import ArticleSticker from '@/containers/tool/ArticleSticker'
17+
import ArticleFooter from '@/containers/unit/ArticleFooter'
1618
import ArtimentBody from '@/widgets/ArtimentBody'
19+
import Comments from '@/containers/unit/Comments'
1720
import Linker from '@/widgets/Linker'
1821

1922
import ViewportTracker from '@/widgets/ViewportTracker'

src/containers/content/ArticleContent/DesktopView/BlogLayout/ArticleTab.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { FC, useRef, Fragment } from 'react'
33
import type { TBlog, TMetric } from '@/spec'
44
import { buildLog } from '@/utils/logger'
55

6-
import { ArticleFooter, Comments } from '@/containers/dynamic'
6+
// import { Comments } from '@/containers/dynamic'
7+
// import ArticleFooter from '@/containers/unit/ArticleFooter'
78
import ArtimentBody from '@/widgets/ArtimentBody'
9+
import Comments from '@/containers/unit/Comments'
810
import Linker from '@/widgets/Linker'
911
import ViewportTracker from '@/widgets/ViewportTracker'
1012

@@ -37,7 +39,7 @@ const ArticleTab: FC<TProps> = ({ metric, article }) => {
3739
<ArticleWrapper ref={ref}>
3840
<Linker src={article.linkAddr} right={10} bottom={25} hint="原文:" />
3941
<ArtimentBody document={article.document} />
40-
<ArticleFooter metric={metric} />
42+
{/* <ArticleFooter metric={metric} /> */}
4143
</ArticleWrapper>
4244

4345
<ViewportTracker

src/containers/content/ArticleContent/DesktopView/WorksLayout/ArticleTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { FC, useRef, Fragment } from 'react'
33
import type { TWorks, TMetric } from '@/spec'
44
import { buildLog } from '@/utils/logger'
55

6-
import { ArticleFooter, Comments } from '@/containers/dynamic'
6+
import ArticleFooter from '@/containers/unit/ArticleFooter'
77
import ArtimentBody from '@/widgets/ArtimentBody'
8+
import Comments from '@/containers/unit/Comments'
89

910
import ViewportTracker from '@/widgets/ViewportTracker'
1011

src/containers/content/ArticleContent/MobileView/index.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import dynamic from 'next/dynamic'
1010
import { buildLog } from '@/utils/logger'
1111
import { bond } from '@/utils/mobx'
1212

13-
import { ArticleFooter, Comments } from '@/containers/dynamic'
13+
import ArticleFooter from '@/containers/unit/ArticleFooter'
14+
import Comments from '@/containers/unit/Comments'
1415
import Maybe from '@/widgets/Maybe'
1516
import ViewportTracker from '@/widgets/ViewportTracker'
17+
import MarkDownRender from '@/widgets/MarkDownRender'
1618

1719
import type { TStore } from '../store'
1820

@@ -26,13 +28,6 @@ import {
2628

2729
import { useInit, articleInAnchor, articleOutAnchor } from '../logic'
2830

29-
export const MarkDownRender = dynamic(
30-
() => import('@/widgets/MarkDownRender'),
31-
{
32-
ssr: false,
33-
},
34-
)
35-
3631
/* eslint-disable-next-line */
3732
const log = buildLog('C:PostContent')
3833

src/containers/content/CommunityContent/HolyGrailLayout.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
*/
66

77
import { FC, memo } from 'react'
8-
import dynamic from 'next/dynamic'
98

109
import { TCommunity, TThread } from '@/spec'
1110

1211
import { C11N, EVENT } from '@/constant'
1312
import { send } from '@/utils/helper'
1413
import { buildLog } from '@/utils/logger'
1514

15+
import ThreadSidebar from '@/containers/thread/ThreadSidebar'
1616
import TabBar from '@/widgets/TabBar'
17-
import { LavaLampLoading } from '@/widgets/dynamic'
17+
// import LavaLampLoading from '@/widgets/Loading/LavaLampLoading'
1818

1919
import ThreadContent from './ThreadContent'
2020
import SubscribedList from './SubscribedList'
@@ -29,15 +29,6 @@ import {
2929
/* eslint-disable-next-line */
3030
const log = buildLog('C:CommunityContent')
3131

32-
const ThreadSidebar = dynamic(
33-
() => import('@/containers/thread/ThreadSidebar'),
34-
{
35-
/* eslint-disable react/display-name */
36-
loading: () => <LavaLampLoading size="small" />,
37-
ssr: false,
38-
},
39-
)
40-
4132
type TProps = {
4233
thread: TThread
4334
community: TCommunity

src/containers/content/CommunityContent/ThreadContent.tsx

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { FC, memo } from 'react'
33
import type { TThread } from '@/spec'
44
import { THREAD } from '@/constant'
55

6-
// import ArticlesThread from '@/containers//thread/ArticlesThread'
7-
// import GtdThread from '@/containers//thread/GtdThread'
8-
// import ChangeThread from '@/containers//thread/ChangelogThread'
6+
import ArticlesThread from '@/containers//thread/ArticlesThread'
7+
import GtdThread from '@/containers//thread/GtdThread'
8+
import ChangeThread from '@/containers//thread/ChangelogThread'
99
// import ReposThread from '@/containers/thread/ReposThread'
1010
import CperMapThread from '@/containers/thread/CperMapThread'
11-
// import AboutThread from '@/containers/thread/AboutThread'
11+
import AboutThread from '@/containers/thread/AboutThread'
1212
import HelpThread from '@/containers/thread/HelpThread'
1313

1414
import WipThread from './WipThread'
@@ -19,10 +19,6 @@ type TProps = {
1919

2020
const ThreadContent: FC<TProps> = ({ thread }) => {
2121
switch (thread) {
22-
case THREAD.KANBAN: {
23-
return <WipThread title="看板" />
24-
}
25-
2622
case THREAD.INTERVIEW: {
2723
return <WipThread title="开发者访谈" />
2824
}
@@ -43,18 +39,32 @@ const ThreadContent: FC<TProps> = ({ thread }) => {
4339
return <WipThread title="违规账户信息" />
4440
}
4541

46-
case THREAD.CPER:
42+
case THREAD.CPER: {
4743
return <CperMapThread />
44+
}
4845

49-
case THREAD.MAP:
46+
case THREAD.MAP: {
5047
return <CperMapThread />
48+
}
5149

52-
default:
53-
// return <AboutThread />
54-
// return <GtdThread />
55-
// return <ChangeThread />
56-
// return <ArticlesThread />
50+
case THREAD.ABOUT: {
51+
return <AboutThread />
52+
}
53+
54+
case THREAD.ROADMAP: {
55+
return <GtdThread />
56+
}
57+
58+
case THREAD.CHANGELOG: {
59+
return <ChangeThread />
60+
}
61+
62+
case THREAD.HELP: {
5763
return <HelpThread />
64+
}
65+
66+
default:
67+
return <ArticlesThread />
5868
}
5969
}
6070

src/containers/content/ExploreContent/Banner.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@ import {
2222
IntroWrapper,
2323
IntroTitle,
2424
IntroDesc,
25-
SloganTextWrapper,
2625
CreateCommunityLink,
2726
SearchIcon,
2827
} from './styles/banner'
2928

3029
import { searchOnChange } from './logic'
3130

32-
export const SloganText = dynamic(() => import('./SloganText'), {
33-
/* eslint-disable react/display-name */
34-
loading: () => <SloganTextWrapper>心爱的作品</SloganTextWrapper>,
35-
ssr: false,
36-
})
37-
3831
/* eslint-disable-next-line */
3932
const log = buildLog('C:CommunitiesBanner')
4033

34+
const SloganText = dynamic(() => import('./SloganText'), {
35+
// eslint-disable-next-line react/display-name
36+
loading: () => <div />,
37+
ssr: false,
38+
})
39+
4140
type TProps = {
4241
searchStatus: TSearchState
4342
}
@@ -75,6 +74,7 @@ const Banner: FC<TProps> = ({
7574
<IntroDesc>
7675
<Space right={24} />
7776
或者,来为你
77+
{/* @ts-ignore */}
7878
<SloganText />
7979
<Link href={`/${ROUTE.APPLY_COMMUNITY}`} passHref>
8080
<CreateCommunityLink>建立一个社区</CreateCommunityLink>

src/containers/content/ExploreContent/CommunityCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { FC, memo } from 'react'
22
import { isEmpty, contains } from 'ramda'
33
import Link from 'next/link'
44

5-
import type { TCommunity, TID } from '@/spec'
5+
import type { TCommunity } from '@/spec'
66
import { NON_FILL_COMMUNITY } from '@/constant'
77
import { prettyNum, cutRest } from '@/utils/helper'
88

99
import { SpaceGrow } from '@/widgets/Common'
10-
import { TrendLine } from '@/widgets/dynamic'
10+
import TrendLine from '@/widgets/TrendLine'
1111

1212
import SubscribeBtn from './SubscribeBtn'
1313

src/containers/content/ExploreContent/SloganText.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC, memo, useEffect, useState } from 'react'
1+
import { Fragment, memo, useEffect, useState } from 'react'
22
import { AnimateOnChange } from 'react-animation'
33

44
import { SloganTextWrapper } from './styles/banner'
@@ -23,7 +23,7 @@ const fixAnimationStockIfNeed = (): void => {
2323
}
2424
}
2525

26-
const SlogenText: FC = () => {
26+
const SlogenText = () => {
2727
const [index, setIndex] = useState(0)
2828

2929
useEffect(() => {
@@ -40,15 +40,15 @@ const SlogenText: FC = () => {
4040
})
4141

4242
return (
43-
<>
43+
<Fragment>
4444
4545
<AnimateOnChange durationOut={500}>
4646
<SloganTextWrapper highlight onClick={fixAnimationStockIfNeed}>
4747
{coolThings[index]}
4848
</SloganTextWrapper>
4949
</AnimateOnChange>
5050
51-
</>
51+
</Fragment>
5252
)
5353
}
5454

src/containers/content/HaveADrinkContent/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import useShortcut from '@/hooks/useShortcut'
1515

1616
import type { TStore } from './store'
1717
import Header from './Header'
18+
// import Body from './Body'
1819
import Footer from './Footer'
1920

2021
import { Wrapper, InnerWrapper, LoadingSentence } from './styles'
@@ -68,6 +69,7 @@ const HaveADrinkContentContainer: FC<TProps> = ({
6869
category={category}
6970
pagiState={pagiState}
7071
/>
72+
{/* @ts-ignore */}
7173
<Body
7274
view={view}
7375
category={category}

0 commit comments

Comments
 (0)