Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a180b89
refactor(workflow): query target community & fix mobx-react issue
mydearxym Oct 11, 2021
5a01b9d
refactor(workflow): create route adjust
mydearxym Oct 11, 2021
b7800f2
refactor(publish-post): wip
mydearxym Oct 11, 2021
259d1e8
refactor(workflow): naming & new favicon
mydearxym Oct 11, 2021
baf6ba0
refactor(workflow): wip
mydearxym Oct 12, 2021
7c628a8
chore(workflow): ts spec
mydearxym Oct 12, 2021
95685c1
chore(workflow): basic publish done
mydearxym Oct 12, 2021
3b301dd
refactor(publish-post): re-org route system
mydearxym Oct 12, 2021
be5aef9
refactor(workflow): update post wip
mydearxym Oct 13, 2021
9b07edd
refactor(workflow): update post with real data
mydearxym Oct 13, 2021
207f76f
refactor(workflow): general TagsList wip
mydearxym Oct 13, 2021
cdbce8b
refactor(workflow): use common viewingArticle as update article
mydearxym Oct 13, 2021
385b389
refactor(article-editor): publish after behaviors
mydearxym Oct 13, 2021
9b220fb
refactor(article-editor): add counter & improve editor inline style
mydearxym Oct 14, 2021
f63bd5c
refactor(article-editor): extract submit button & re-org tagsetter wip
mydearxym Oct 15, 2021
37977f7
refactor(TagSetter): add canActOnSeleted opt
mydearxym Oct 15, 2021
726790e
refactor(TagSetter): wip
mydearxym Oct 16, 2021
8e224e7
fix(Modal): close logic, esc hint style
mydearxym Oct 16, 2021
684cdc7
refactor(CommunityTagSetter): re-org
mydearxym Oct 16, 2021
48cdeca
refactor(CommunityTagSetter): type issue
mydearxym Oct 16, 2021
b28bb72
chore(type): add TInput type
mydearxym Oct 16, 2021
c61a8d1
refactor(publish): communityBadege change community logic
mydearxym Oct 16, 2021
46b4af4
refactor: community setter logo
mydearxym Oct 16, 2021
0ef886e
refactor(community-card): add slash for raw
mydearxym Oct 16, 2021
8d7d069
chore: account-solid svg back-in
mydearxym Oct 16, 2021
55f49b5
refactor(taglist): setter style adjust & re-org
mydearxym Oct 16, 2021
0fc05e8
refactor(word-counter): add TSpace to WordCounter
mydearxym Oct 16, 2021
7f8950d
refactor(community-tag-setter): debug with real data & re-org
mydearxym Oct 17, 2021
a079589
refactor(tag-setter): basic workflow
mydearxym Oct 17, 2021
940eeac
refactor: enhance publish after & tag, and style
mydearxym Oct 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ next-env.d.ts
*.png
*.jpeg
*.txt
*.md
*.md
*.ico
170 changes: 129 additions & 41 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"dependencies": {
"@babel/core": "^7.13.14",
"@groupher/react-editor": "^1.1.26",
"@groupher/react-editor": "^1.1.28",
"@next/bundle-analyzer": "^9.4.4",
"@sentry/browser": "5.17.0",
"@sentry/node": "5.17.0",
Expand Down Expand Up @@ -112,6 +112,7 @@
"resize-observer-polyfill": "^1.5.1",
"response-time": "^2.3.2",
"rxjs": "6.2.2",
"sanitize-html": "^2.5.2",
"scroll-into-view-if-needed": "1.5.0",
"sentry-testkit": "^2.1.0",
"store": "^2.0.12",
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions server/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const renderAndCache = ({ req, res, path }) => {
// do not cache in dev mode
if (dev) {
const pagePath = path || req.path
console.log('# pagePath: ', pagePath)
return app.render(req, res, pagePath, {
...req.query,
...req.params,
Expand Down
47 changes: 22 additions & 25 deletions server/routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const router = require('express').Router()
const R = require('ramda')

const app = require('./app')
const { renderAndCache } = require('./helper')
Expand All @@ -22,7 +21,7 @@ router.route('/oauth/').get((req, res) => renderAndCache({ req, res }))
// 将首页重定向到 HOME_PAGE
router
.route('/')
.get((req, res) => renderAndCache({ req, res, path: '/community' }))
.get((req, res) => renderAndCache({ req, res, path: '/index' }))

// 来一杯
router.route('/have-a-drink/:slug?').get((req, res) => {
Expand Down Expand Up @@ -85,7 +84,8 @@ router.route('/user/:userId').get((req, res) => {

// 帖子页
router.route('/post/:id').get((req, res) => {
return renderAndCache({ req, res, path: '/post' })
const { id } = req.params
return renderAndCache({ req, res, path: `/post/${id}` })
})

// job 帖子页
Expand All @@ -99,28 +99,34 @@ router.route('/:community/video/:id').get((req, res) => {
})

// repo 帖子页
router.route('/:community/repo/:id').get((req, res) => {
return renderAndCache({ req, res, path: '/repo' })
})
// router.route('/:community/repo/:id').get((req, res) => {
// return renderAndCache({ req, res, path: '/repo' })
// })

// 创建新社区
router.route('/create/community').get((req, res) => {
return renderAndCache({ req, res, page: '/create/community' })
router.route('/publish/community').get((req, res) => {
return renderAndCache({ req, res, page: '/publish/community' })
})

// 创建新帖子
router.route('/publish/post').get((req, res) => {
return renderAndCache({ req, res, page: '/publish/post' })
})

// 创建新内容
router.route('/create/article').get((req, res) => {
return renderAndCache({ req, res, page: '/create/article' })
// 编辑新帖子
router.route('/update/post/:id').get((req, res) => {
const { id } = req.params
return renderAndCache({ req, res, path: `/update/post/${id}` })
})

// 创建新博客
router.route('/create/blog').get((req, res) => {
return renderAndCache({ req, res, page: '/create/blog' })
router.route('/publish/blog').get((req, res) => {
return renderAndCache({ req, res, page: '/publish/blog' })
})

// 创建新作品
router.route('/create/works').get((req, res) => {
return renderAndCache({ req, res, page: '/create/works' })
router.route('/publish/works').get((req, res) => {
return renderAndCache({ req, res, page: '/publish/works' })
})

// 所有社区
Expand All @@ -137,16 +143,7 @@ router.route('/:community/help-center').get((req, res) => {

// 社区主页
router.route('/:community/:thread').get((req, res) => {
if (
R.has('preview', req.query) &&
R.has('id', req.query) &&
R.has('community', req.query)
) {
const { community, preview, id } = req.query
return res.redirect(`/${community}/${preview}/${id}`)
}

return renderAndCache({ req, res, path: '/community' })
return renderAndCache({ req, res, path: '/index' })
})

router.route('*').get((req, res) => handle(req, res))
Expand Down
6 changes: 3 additions & 3 deletions src/components/ArticleCard/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { TJob, TRadar } from '@/spec'
import { ICON } from '@/config'
import { THREAD } from '@/constant'
import { cutRest } from '@/utils/helper'
import InlineTags from '@/components/InlineTags'
import TagsList from '@/components/TagsList'
import { Br } from '@/components/Common'

import type { TProps as TIndex } from './index'
Expand Down Expand Up @@ -33,7 +33,7 @@ const Header: FC<TIndex> = ({ data, thread }) => {
<Br top={4} />
<Title>{cutRest(title, 100)}</Title>
<Br top={6} />
<InlineTags items={articleTags} mLeft={0} size="medium" />
<TagsList items={articleTags} mLeft={0} size="medium" />
</Wrapper>
)
}
Expand All @@ -43,7 +43,7 @@ const Header: FC<TIndex> = ({ data, thread }) => {

return (
<Wrapper>
<InlineTags items={articleTags} mLeft={0} size="medium" />
<TagsList items={articleTags} mLeft={0} size="medium" />
<Br top={10} />
<Title>
<ExtraInfo>
Expand Down
87 changes: 0 additions & 87 deletions src/components/ArticleEditToolbar/CopyrightSelector.js

This file was deleted.

71 changes: 0 additions & 71 deletions src/components/ArticleEditToolbar/index.js

This file was deleted.

51 changes: 0 additions & 51 deletions src/components/ArticleEditToolbar/styles/copyright_selector.ts

This file was deleted.

Loading