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

Commit 510a06e

Browse files
authored
refactor: community apply workflow (#1189)
* refactor(publish-community): page js -> ts * refactor(community-publish): adjust styles * refactor(publish-community): more js -> ts * refactor(community-publish): style adjust, wip * refactor(community-publish): style & text adjust, wip * refactor(community-publish): info banner layout adjust * refactor(publish-community): adjust style & validation * refactor(community-publish): add finished state * chore: some rule & community/article editor style * chore(works-editor): style & rules * chore(works-editor): footer style & toast style adjust * chore(works-editor): rules adjust * chore(works-editor): rules adjust * chore(works-editor): pending & exist check * chore(works-editor): demo community re-org * refactor(community): apply community workflow * refactor(apply-community): more-info ux * refactor(community-apply): more apply info workflow * refactor(community-apply): support more types * refactor(community-apply): route publish -> apply
1 parent cc444bf commit 510a06e

Some content is hidden

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

76 files changed

+1885
-1033
lines changed

package-lock.json

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"sentry-testkit": "^2.1.0",
120120
"store": "^2.0.12",
121121
"stringz": "^2.0.0",
122-
"styled-components": "5.3.0",
122+
"styled-components": "^5.3.3",
123123
"timeago-react": "3.0.2",
124124
"tinykeys": "^1.0.6",
125125
"urql": "^2.0.4"

server/routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ router.route('/radar/:id').get((req, res) => {
116116
// return renderAndCache({ req, res, path: '/repo' })
117117
// })
118118

119-
// 创建新社区
120-
router.route('/publish/community').get((req, res) => {
121-
return renderAndCache({ req, res, page: '/publish/community' })
119+
// 申请新社区
120+
router.route('/apply/community').get((req, res) => {
121+
return renderAndCache({ req, res, page: '/apply/community' })
122122
})
123123

124124
// 创建新帖子

src/containers/content/ExploreContent/Banner.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import dynamic from 'next/dynamic'
1010

1111
import type { TSearchState } from './spec'
1212
import { ICON_CMD } from '@/config'
13+
import { ROUTE } from '@/constant'
1314
import { buildLog } from '@/utils/logger'
1415

1516
import SearchBox from './SearchBox'
@@ -77,7 +78,7 @@ const Banner: FC<TProps> = ({
7778
<IntroDesc>
7879
或者,来为你
7980
<SloganText />
80-
<Link href="/create/community" passHref>
81+
<Link href={`/${ROUTE.APPLY_COMMUNITY}`} passHref>
8182
<CreateCommunityLink>建立一个社区</CreateCommunityLink>
8283
</Link>
8384
吧!

src/containers/content/ExploreContent/SloganText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { AnimateOnChange } from 'react-animation'
33

44
import { SloganTextWrapper } from './styles/banner'
55

6-
const coolThings = ['心爱的作品', '骄傲的团队', '沉淀的知识']
7-
const SWITCH_INTERVAL = 3000
6+
const coolThings = ['心爱的作品', '骄傲的团队', '想聊的领域']
7+
const SWITCH_INTERVAL = 4000
88

99
/*
1010
this line is a hack for AnimateOnChange bug

src/containers/content/ExploreContent/styles/banner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export const SloganTextWrapper = styled.div<{ highlight?: boolean }>`
5151
highlight ? theme('thread.articleTitle') : theme('thread.articleDigest')};
5252
`
5353
export const CreateCommunityLink = styled.a`
54-
color: #327faf;
54+
color: ${theme('button.primary')};
5555
margin-right: 3px;
56+
text-decoration: none;
5657
5758
&:hover {
5859
cursor: pointer;

src/containers/content/ExploreContent/styles/search_box.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export const InputWrapper = styled.div`
1414
${css.flex('align-center')};
1515
border-radius: 20px;
1616
padding: 10px 18px;
17-
background-color: ${theme('content.cardBg')};
17+
background-color: #0b2631;
1818
margin-bottom: 8px;
1919
opacity: 0.8;
2020
border: 1px solid #1e6184;
2121
&:hover {
22-
background-color: ${theme('content.cardBg')};
22+
background-color: #0b2631;
2323
opacity: 1;
2424
border: 1px solid #327faf;
2525
}

src/containers/editor/ArticleEditor/store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ const ArticleEditor = T.model('ArticleEditor', {
6464
const slf = self as TStore
6565
const { mode, accountInfo, viewingArticle } = slf
6666

67-
return (
68-
mode === 'update' && accountInfo.login === viewingArticle.author?.login
69-
)
67+
if (mode === 'publish') return true
68+
69+
return accountInfo.login === viewingArticle.author?.login
7070
},
7171
get thread(): TArticleThread {
7272
const root = getParent(self) as TRootStore
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-disable jsx-a11y/accessible-emoji */
2+
import { FC, memo } from 'react'
3+
4+
import { Wrapper, Title, Desc } from '../styles/banner/finished'
5+
6+
// import type { TSetupDomainStatus, TValidState } from '../spec'
7+
8+
const Finished: FC = () => {
9+
return (
10+
<Wrapper>
11+
<Title>👏🏻 &nbsp;&nbsp;感谢你的信任</Title>
12+
<Desc>申请将尽快被处理,结果将以邮件等形式告知。</Desc>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(Finished)

src/containers/editor/CommunityEditor/Banner/InputBox.js

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)