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

Commit 55df9a0

Browse files
committed
feat(wip): github repo update
1 parent c2d52a4 commit 55df9a0

File tree

9 files changed

+25
-6
lines changed

9 files changed

+25
-6
lines changed

components/ArticleActionsPanel/EditOption.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import T from 'prop-types'
33

44
import { ICON_CMD } from '@config'
5+
import { THREAD } from '@utils'
56
import withGuardian from '@components/HOC/withGuardian'
67

78
import { Option, OptionIcon, OptionTitle } from './styles'
@@ -10,7 +11,11 @@ const EditOption = ({ thread, onEdit }) => (
1011
<React.Fragment>
1112
<Option onClick={onEdit.bind(this, thread)}>
1213
<OptionIcon src={`${ICON_CMD}/edit.svg`} />
13-
<OptionTitle>编辑</OptionTitle>
14+
{thread === THREAD.REPO ? (
15+
<OptionTitle>更新 README.md</OptionTitle>
16+
) : (
17+
<OptionTitle>编辑</OptionTitle>
18+
)}
1419
</Option>
1520
</React.Fragment>
1621
)

components/GithubRepoPage/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const log = buildLog('c:GithubRepoPage:index')
3232

3333
const GithubRepoPage = ({
3434
repo,
35+
updating,
3536
onSearch,
3637
onPublish,
3738
onSync,
@@ -43,7 +44,7 @@ const GithubRepoPage = ({
4344
publishing,
4445
readOnly,
4546
}) => (
46-
<Wrapper>
47+
<Wrapper updating={updating}>
4748
{!readOnly ? (
4849
<React.Fragment>{viewerHeader}</React.Fragment>
4950
) : (
@@ -87,6 +88,7 @@ const GithubRepoPage = ({
8788

8889
GithubRepoPage.propTypes = {
8990
repo: T.object.isRequired,
91+
updating: T.bool,
9092
onPublish: T.func,
9193
onSearch: T.func,
9294
onSync: T.func,
@@ -103,6 +105,7 @@ GithubRepoPage.propTypes = {
103105
}
104106

105107
GithubRepoPage.defaultProps = {
108+
updating: false,
106109
onPublish: log,
107110
onSearch: log,
108111
onSync: log,

components/GithubRepoPage/sch

Whitespace-only changes.

components/GithubRepoPage/styles/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import styled from 'styled-components'
22
import { Button } from 'antd'
33

44
// import Img from '@Img'
5-
import { theme, cs } from '@utils'
5+
import { theme, cs, animate } from '@utils'
66

7-
export const Wrapper = styled.div``
7+
export const Wrapper = styled.div`
8+
animation: ${({ updating }) => (updating ? animate.updatingRule : '')};
9+
`
810

911
export const BodyWrapper = styled.div`
1012
${cs.flexColumn('align-center')};

containers/Preview/Viewer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ const Viewer = ({ type, root, attachment, attUser }) => {
7070
case TYPE.PREVIEW_REPO_CREATE:
7171
return <DynamicRepoEditor />
7272

73+
case TYPE.PREVIEW_REPO_EDIT:
74+
return <DynamicRepoEditor />
75+
7376
// video
7477
case TYPE.PREVIEW_VIDEO_EDIT:
7578
return <DynamicVideoEditor attachment={attachment} />

containers/Preview/store.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const THREAD_CONTENT_CURD_TYPES = [
3232
// repo
3333
TYPE.PREVIEW_REPO_VIEW,
3434
TYPE.PREVIEW_REPO_CREATE,
35+
TYPE.PREVIEW_REPO_EDIT,
3536
// video
3637
TYPE.PREVIEW_VIDEO_VIEW,
3738
TYPE.PREVIEW_VIDEO_CREATE,

containers/TagsBar/TagOptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const TagOptions = ({ onInclude }) => (
1616
<IncludeOption onClick={onInclude}>只看</IncludeOption>
1717
<MoreIcon src={`${ICON_CMD}/more.svg`} />
1818
<Popover
19-
placement="bottom"
19+
placement="bottomRight"
2020
trigger="click"
2121
content={<DiscussLinker title="不看" addr={`${ISSUE_ADDR}/322`} />}
2222
>

utils/animations.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ const rotate360CloseRule = css`
110110
${rotate360} 2s cubic-bezier(0, 0.56, 0.24, 0.72);
111111
`
112112
const breathRule = css`
113-
${breath} 2s linear infinite;
113+
${breath} 1.5s linear infinite;
114+
`
115+
const updatingRule = css`
116+
${breath} 1.2s linear infinite;
114117
`
115118

116119
const animate = {
@@ -129,6 +132,7 @@ const animate = {
129132
rotate360CloseRule,
130133
// breath
131134
breathRule,
135+
updatingRule,
132136
}
133137

134138
export default animate

utils/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export const TYPE = {
104104

105105
PREVIEW_REPO_VIEW: 'PREVIEW_REPO_VIEW',
106106
PREVIEW_REPO_CREATE: 'PREVIEW_REPO_CREATE',
107+
PREVIEW_REPO_EDIT: 'PREVIEW_REPO_EDIT',
107108

108109
PREVIEW_VIDEO_VIEW: 'PREVIEW_VIDEO_VIEW',
109110
PREVIEW_VIDEO_CREATE: 'PREVIEW_VIDEO_CREATE',

0 commit comments

Comments
 (0)