Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit6f734d8

Browse files
committed
Merge branch 'cs-thread' into dev
2 parents2813a98 +f9678b5 commit6f734d8

File tree

52 files changed

+840
-561
lines changed

Some content is hidden

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

52 files changed

+840
-561
lines changed

‎components/CommunityContent/index.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ReposThread from '../../containers/ReposThread'
1313
importWikiThreadfrom'../../containers/WikiThread'
1414
importJobsThreadfrom'../../containers/JobsThread'
1515
importUsersThreadfrom'../../containers/UsersThread'
16-
importCheatSheetPaperfrom'../../containers/CheatSheetPaper'
16+
importCheatsheetThreadfrom'../../containers/CheatsheetThread'
1717

1818
import{Wrapper}from'./styles'
1919
import{makeDebugger,ROUTE}from'../../utils'
@@ -42,8 +42,8 @@ const ComunityContent = ({ curRoute }) => {
4242
caseROUTE.WIKI:{
4343
return<WikiThread/>
4444
}
45-
case'cheatsheet':{
46-
return<CheatSheetPaper/>
45+
caseROUTE.CHEATSHEET:{
46+
return<CheatsheetThread/>
4747
}
4848
default:{
4949
return<div>default</div>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
*
3+
* ContributorList
4+
*
5+
*/
6+
7+
importReactfrom'react'
8+
importPropTypesfrom'prop-types'
9+
10+
importMaybefrom'../Maybe'
11+
importPopoverfrom'../Popover'
12+
importGithubUserCardfrom'../GithubUserCard'
13+
importAvatarAdderfrom'../../containers/AvatarAdder'
14+
15+
import{Wrapper,AvatarLink,Avatar,CardWrapper}from'./styles'
16+
17+
import{makeDebugger,uid}from'../../utils'
18+
/* eslint-disable no-unused-vars */
19+
constdebug=makeDebugger('c:ContributorList:index')
20+
/* eslint-enable no-unused-vars */
21+
22+
constContributorList=({ users, showAdder, addContributor})=>(
23+
<Wrapper>
24+
{users.map(user=>(
25+
<Popover
26+
content={
27+
<CardWrapper>
28+
<GithubUserCarduser={user}/>
29+
</CardWrapper>
30+
}
31+
placement="bottom"
32+
trigger="hover"
33+
key={uid.gen()}
34+
>
35+
<AvatarLink>
36+
<Avatarsrc={user.avatar}/>
37+
</AvatarLink>
38+
</Popover>
39+
))}
40+
41+
<Maybetest={showAdder}>
42+
<AvatarAdderonConfirm={addContributor}/>
43+
</Maybe>
44+
</Wrapper>
45+
)
46+
47+
ContributorList.propTypes={
48+
users:PropTypes.arrayOf(
49+
PropTypes.shape({
50+
avatar:PropTypes.string,
51+
nickname:PropTypes.string,
52+
bio:PropTypes.string,
53+
company:PropTypes.string,
54+
location:PropTypes.string,
55+
htmlUrl:PropTypes.string,
56+
})
57+
).isRequired,
58+
addContributor:PropTypes.func,
59+
showAdder:PropTypes.bool,
60+
}
61+
62+
ContributorList.defaultProps={
63+
addContributor:debug,
64+
showAdder:false,
65+
}
66+
67+
exportdefaultContributorList

‎containers/WikiThread/styles/avatar_list.js‎renamed to ‎components/ContributorList/styles/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
importstyledfrom'styled-components'
22

3-
importImgfrom'../../../components/Img'
4-
/* import { theme } from '../../../utils' */
3+
importImgfrom'../../Img'
4+
// import { theme } from '../../../utils'
55

66
exportconstWrapper=styled.div`
77
display: flex;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// import React from 'react'
2+
// import { shallow } from 'enzyme'
3+
4+
// import ContributorList from '../index'
5+
6+
describe('TODO <ContributorList />',()=>{
7+
it('Expect to have unit tests specified',()=>{
8+
expect(true).toEqual(true)
9+
})
10+
})

‎components/EmptyThread/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const DescContent = ({ community, thread }) => (
3434
<React.Fragment>
3535
<div>
3636
如果你有{community} 相关的优质
37-
{translator[thread]}
37+
{translator[thread]||thread}
3838
,欢迎一起分享 / 交流
3939
</div>
4040
<div>
@@ -55,7 +55,7 @@ const EmptyThread = ({ community, thread }) => (
5555
<Text>
5656
<Title>
5757
{community} 社区内未找到符合相关条件的
58-
{translator[thread]}
58+
{translator[thread]||thread}
5959
</Title>
6060
<DescWrapper>
6161
<DescContentcommunity={community}thread={thread}/>

‎components/EmptyThread/styles/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const Wrapper = styled.div`
1010
width: 100%;
1111
height: 100%;
1212
margin-top: 10%;
13+
margin-bottom: 30px;
1314
`
1415

1516
exportconstIcon404=styled(Img)`

‎components/LoadingEffects/CheatSheetLoading.js‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
importReactfrom'react'
22
importPropTypesfrom'prop-types'
3-
importMasonryfrom'react-masonry-component'
43
importRfrom'ramda'
54
import{withTheme}from'styled-components'
65

7-
// import Loading, { Rect, Circle } from 'react-content-loader'
86
importContentLoaderfrom'react-content-loader'
97

8+
import{Wrapper,CheatsheetCard}from'./styles'
9+
1010
import{makeDebugger,uid}from'../../utils'
1111
/* eslint-disable no-unused-vars */
1212
constdebug=makeDebugger('c:LoadingEffects:index')
1313
/* eslint-enable no-unused-vars */
1414

15-
/* eslint-disable no-unused-vars */
1615
constLoadingBlock=({ theme})=>(
17-
/* eslint-enable no-unused-vars */
18-
19-
<divstyle={{width:'45%',overflow:'hidden',marginTop:20,height:180}}>
16+
<CheatsheetCard>
2017
<ContentLoader
2118
height={200}
2219
width={280}
2320
speed={2}
24-
primaryColor="#f3f3f3"
25-
secondaryColor="#ecebeb"
21+
primaryColor={theme.loading.basic}
22+
secondaryColor={theme.loading.animate}
2623
>
2724
<rectx="0"y="0"rx="3"ry="3"width="70"height="10"/>
2825
<rectx="80"y="0"rx="3"ry="3"width="100"height="10"/>
@@ -34,15 +31,15 @@ const LoadingBlock = ({ theme }) => (
3431
<rectx="185"y="40"rx="3"ry="3"width="60"height="10"/>
3532
<rectx="0"y="60"rx="3"ry="3"width="30"height="10"/>
3633
</ContentLoader>
37-
</div>
34+
</CheatsheetCard>
3835
)
3936

4037
constCheatSheetLoading=({ column, theme})=>(
41-
<Masonry>
38+
<Wrapper>
4239
{R.range(0,column).map(()=>(
4340
<LoadingBlockkey={uid.gen()}theme={theme}/>
4441
))}
45-
</Masonry>
42+
</Wrapper>
4643
)
4744

4845
CheatSheetLoading.propTypes={
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
importstyledfrom'styled-components'
2+
3+
// import { Img } from '../../../components'
4+
// import { theme } from '../../../utils'
5+
6+
exportconstWrapper=styled.div`
7+
display: flex;
8+
flex-wrap: wrap;
9+
`
10+
exportconstCheatsheetCard=styled.div`
11+
width: 44%;
12+
overflow: hidden;
13+
margin-top: 20px;
14+
height: 180px;
15+
margin-right: 50px;
16+
`

‎components/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export { default as SectionLabel } from './SectionLabel'
4343
export{defaultasBuyMeChuanChuan}from'./BuyMeChuanChuan'
4444
export{defaultasVideoSourceInfo}from'./VideoSourceInfo'
4545

46+
export{defaultasContributorList}from'./ContributorList'
4647
export{defaultasGithubRepoPage}from'./GithubRepoPage'
4748
export{defaultasGithubUserCard}from'./GithubUserCard'
4849

‎config/endpoint.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ export const GITHUB_ADDR = 'https://github.com/coderplanets/coderplanets_web'
2828
exportconstGITHUB_ME='https://github.com/mydearxym'
2929
exportconstISSUE_ADDR=`${GITHUB_ADDR}/issues/new`
3030
exportconstMENTION_USER_ADDR='https://coderplanets.com/users/'
31+
32+
exportconstCOMMUNITY_WIKI=
33+
'https://github.com/coderplanets/cps_cheatsheets/blob/master'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp