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.

Commit2813a98

Browse files
committed
Merge branch 'wiki-thread' into dev
2 parentse75f0a9 +bfb001d commit2813a98

File tree

53 files changed

+1293
-416
lines changed

Some content is hidden

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

53 files changed

+1293
-416
lines changed

‎components/GithubRepoPage/StatesContainers.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const StatesContainers = ({ repo }) => (
9191
<BoxWrapper>
9292
<Label>License</Label>
9393
<Numbersmall={repo.license.length>5}>
94-
{R.toUpper(repo.license)}
94+
{R.toUpper(repo.license)||'--'}
9595
</Number>
9696
</BoxWrapper>
9797
</Linker>

‎components/GithubUserCard/index.js‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
*
3+
* GithubUserCard
4+
*
5+
*/
6+
7+
importReactfrom'react'
8+
importPropTypesfrom'prop-types'
9+
10+
import{ICON_CMD}from'../../config'
11+
12+
import{
13+
Wrapper,
14+
PopAvatarWrapper,
15+
UserPopInfo,
16+
PopAvatar,
17+
Username,
18+
UserBio,
19+
UserLocation,
20+
UserCompany,
21+
LabelIcon,
22+
LabelText,
23+
}from'./styles'
24+
25+
import{makeDebugger,nilOrEmpty}from'../../utils'
26+
/* eslint-disable no-unused-vars */
27+
constdebug=makeDebugger('c:GithubUserCard:index')
28+
/* eslint-enable no-unused-vars */
29+
30+
constGithubUserCard=({ user})=>(
31+
<Wrapper>
32+
<PopAvatarWrapper>
33+
<PopAvatarsrc={user.avatar}/>
34+
</PopAvatarWrapper>
35+
<UserPopInfo>
36+
<Username>{user.nickname}</Username>
37+
{!nilOrEmpty(user.bio) ?<UserBio>{user.bio}</UserBio> :null}
38+
{!nilOrEmpty(user.location) ?(
39+
<UserLocation>
40+
<LabelIconsrc={`${ICON_CMD}/city_map.svg`}/>
41+
<LabelText>{user.location}</LabelText>
42+
</UserLocation>
43+
) :null}
44+
{!nilOrEmpty(user.company) ?(
45+
<UserCompany>
46+
<LabelIconsrc={`${ICON_CMD}/profile_company.svg`}/>
47+
<LabelText>{user.company}</LabelText>
48+
</UserCompany>
49+
) :null}
50+
</UserPopInfo>
51+
</Wrapper>
52+
)
53+
54+
GithubUserCard.propTypes={
55+
// https://www.npmjs.com/package/prop-types
56+
user:PropTypes.shape({
57+
nickname:PropTypes.string.isRequired,
58+
avatar:PropTypes.string.isRequired,
59+
bio:PropTypes.string,
60+
location:PropTypes.string,
61+
company:PropTypes.string,
62+
}),
63+
}
64+
65+
GithubUserCard.defaultProps={
66+
user:{
67+
location:'',
68+
company:'',
69+
bio:'',
70+
},
71+
}
72+
73+
exportdefaultGithubUserCard
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
importstyledfrom'styled-components'
2+
3+
importImgfrom'../../Img'
4+
import{theme}from'../../../utils'
5+
6+
exportconstWrapper=styled.div`
7+
display: flex;
8+
max-width: 300px;
9+
`
10+
exportconstPopAvatarWrapper=styled.div`
11+
margin-right: 10px;
12+
padding-top: 4px;
13+
`
14+
exportconstPopAvatar=styled(Img)`
15+
width: 80px;
16+
height: 80px;
17+
`
18+
exportconstUserPopInfo=styled.div`
19+
display: flex;
20+
flex-direction: column;
21+
`
22+
exportconstUsername=styled.div`
23+
color:${theme('thread.articleTitle')};
24+
font-weight: bolder;
25+
font-size: 1rem;
26+
`
27+
exportconstUserBio=styled.div`
28+
color:${theme('thread.articleDigest')};
29+
font-size: 0.9rem;
30+
margin-bottom: 10px;
31+
`
32+
exportconstUserLocation=styled.div`
33+
display: flex;
34+
align-items: center;
35+
`
36+
exportconstLabelIcon=styled(Img)`
37+
fill:${theme('thread.articleTitle')};
38+
width: 15px;
39+
height: 15px;
40+
display: block;
41+
margin-right: 5px;
42+
`
43+
exportconstLabelText=styled.div`
44+
color:${theme('thread.articleTitle')};
45+
`
46+
exportconstUserCompany=styled.div`
47+
display: flex;
48+
align-items: center;
49+
`
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 GithubUserCard from '../index'
5+
6+
describe('TODO <GithubUserCard />',()=>{
7+
it('Expect to have unit tests specified',()=>{
8+
expect(true).toEqual(true)
9+
})
10+
})

‎components/MarkDownRender/index.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,22 @@ const debug = makeDebugger('c:MarkDownRender:index')
3030
/* eslint-enable no-unused-vars */
3131

3232
classMarkDownRenderextendsReact.Component{
33+
state={
34+
body:'',
35+
}
36+
3337
componentDidMount(){
3438
Prism.highlightAll()
39+
setTimeout(()=>Prism.highlightAll(),1000)
40+
}
41+
42+
componentWillReceiveProps(nextProps){
43+
const{ body}=this.state
44+
45+
if(nextProps.body!==body){
46+
this.setState({body:nextProps.body})
47+
setTimeout(()=>Prism.highlightAll(),1000)
48+
}
3549
}
3650

3751
render(){

‎components/OauthHinter/styles/index.js‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
importstyled,{keyframes}from'styled-components'
1+
importstyledfrom'styled-components'
22

33
importImgfrom'../../Img'
4-
import{theme}from'../../../utils'
4+
import{theme,Animate}from'../../../utils'
55

66
exportconstContainer=styled.div`
77
display: flex;
@@ -49,25 +49,14 @@ export const CPSLogoIcon = styled(Img)`
4949
height: 53px;
5050
margin-top: -5px;
5151
`
52-
53-
constrotate360=keyframes`
54-
from {
55-
transform: rotate(0deg);
56-
}
57-
58-
to {
59-
transform: rotate(360deg);
60-
}
61-
`
62-
6352
exportconstLinkIcon=styled(Img)`
6453
fill: #6e967f;
6554
width: 23px;
6655
height: 23px;
6756
margin-left: 25px;
6857
margin-right: 25px;
6958
margin-top: 16px;
70-
animation:${rotate360} 2s linear infinite;
59+
animation:${Animate.rotate360} 2s linear infinite;
7160
`
7261

7362
exportconstGithubLogoIcon=styled(Img)`

‎components/RepoItem/styles/footer.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const PopoverInfo = styled.div`
3737
exportconstPopAvatar=styled(Img)`
3838
width: 80px;
3939
height: 80px;
40+
border-radius: 3px;
4041
`
4142
exportconstPopLink=styled.a`
4243
color:${theme('thread.articleTitle')};

‎components/index.js‎

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

4646
export{defaultasGithubRepoPage}from'./GithubRepoPage'
47+
export{defaultasGithubUserCard}from'./GithubUserCard'
4748

4849
// loading component
4950
export{
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
importReactfrom'react'
2+
3+
import{ICON_CMD}from'../../config'
4+
5+
import{GithubUserCard,Maybe}from'../../components'
6+
7+
import{
8+
Wrapper,
9+
Header,
10+
SearchWrapper,
11+
LabelIcon,
12+
SearchInput,
13+
Result,
14+
Divider,
15+
Footer,
16+
AddBtn,
17+
AdderIcon,
18+
}from'./styles/adder_panel'
19+
20+
importSearchLoingfrom'./SearchLoading'
21+
22+
import*aslogicfrom'./logic'
23+
24+
constAdderPanel=({ user, searchValue, searching, onConfirm})=>(
25+
<Wrapper>
26+
<Header>
27+
<LabelIconsrc={`${ICON_CMD}/github.svg`}/>
28+
<SearchInput
29+
value={searchValue}
30+
placeholder="github username"
31+
onChange={logic.inputOnChange}
32+
onKeyPress={logic.onSearch}
33+
/>
34+
</Header>
35+
<Maybe
36+
test={!searching}
37+
loading={
38+
<SearchWrapper>
39+
<SearchLoing/>
40+
</SearchWrapper>
41+
}
42+
>
43+
<Maybetest={user}>
44+
<Result>
45+
<Divider/>
46+
<GithubUserCarduser={user}/>
47+
<Divider/>
48+
<Footer>
49+
<AddBtnonClick={onConfirm}>
50+
<AdderIconsrc={`${ICON_CMD}/add.svg`}/>
51+
<div>添加</div>
52+
</AddBtn>
53+
</Footer>
54+
</Result>
55+
</Maybe>
56+
</Maybe>
57+
</Wrapper>
58+
)
59+
60+
exportdefaultAdderPanel
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
importReactfrom'react'
2+
3+
import{ICON_CMD}from'../../config'
4+
5+
import{Wrapper,LoadingIcon,LoadingText}from'./styles/search_loading'
6+
7+
constSearchLoing=()=>(
8+
<Wrapper>
9+
<LoadingIconsrc={`${ICON_CMD}/loading_sand.svg`}/>
10+
<LoadingText>Searching ...</LoadingText>
11+
</Wrapper>
12+
)
13+
14+
exportdefaultSearchLoing

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp