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.

Commit8929eae

Browse files
committed
Merge branch 'userpage' into dev
2 parents7c9501b +65ba954 commit8929eae

File tree

69 files changed

+1121
-377
lines changed

Some content is hidden

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

69 files changed

+1121
-377
lines changed

‎components/EmptyLabel/index.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@ import { makeDebugger } from '../../utils'
1515
constdebug=makeDebugger('c:EmptyLabel:index')
1616
/* eslint-enable no-unused-vars */
1717

18-
constEmptyLabel=({ text, iconSrc})=>(
18+
constEmptyLabel=({ text, iconSrc, size})=>(
1919
<Wrapper>
20-
<Iconsrc={iconSrc}/>
21-
<Title>{text}</Title>
20+
<Iconsrc={iconSrc}size={size}/>
21+
<Titlesize={size}>{text}</Title>
2222
</Wrapper>
2323
)
2424

2525
EmptyLabel.propTypes={
2626
iconSrc:PropTypes.string,
2727
text:PropTypes.string,
28+
size:PropTypes.oneOf(['default','large']),
2829
}
2930

3031
EmptyLabel.defaultProps={
3132
text:'啥子都没得 ...',
3233
iconSrc:`${ICON_CMD}/planet_v2.svg`,
34+
size:'default',
3335
}
3436

3537
exportdefaultEmptyLabel

‎components/EmptyLabel/styles/index.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ export const Wrapper = styled.div`
1414
`
1515
exportconstTitle=styled.div`
1616
margin-top: 10px;
17+
font-size:${({ size})=>(size==='default' ?'1rem' :'1.4rem;')};
1718
`
1819

1920
exportconstIcon=styled(Img)`
2021
fill:${theme('banner.desc')};
21-
width: 70px;
22-
height: 70px;
22+
width:${({ size})=>(size==='default' ?'70px' :'100px')};
23+
height:${({ size})=>(size==='default' ?'70px' :'100px')};
2324
`

‎components/Modal/styles/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const Wrapper = styled.div`
1919
position: relative;
2020
background:${theme('modal.bg')};
2121
margin: 0 auto;
22-
top:15%;
22+
top:13%;
2323
width:${({ width})=>width};
2424
min-height: 320px;
2525
max-height: 80vh;

‎components/SectionLabel/index.js‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,22 @@ import { makeDebugger } from '../../utils'
2828
constdebug=makeDebugger('c:SectionLabel:index')
2929
/* eslint-enable no-unused-vars */
3030

31-
constSectionLabel=({ title, iconSrc, desc, node, withAdder, onAdd})=>(
31+
constSectionLabel=({
32+
title,
33+
iconSrc,
34+
desc,
35+
node,
36+
withAdder,
37+
onAdd,
38+
adderText,
39+
})=>(
3240
<Wrapper>
3341
<Label>
3442
<LabelIconsrc={iconSrc}/>
3543
<Title>{title}</Title>
3644
<AdderWrappershow={withAdder}onClick={onAdd}>
3745
<AdderIconsrc={`${ICON_CMD}/add_circle.svg`}/>
38-
<AdderText>添加</AdderText>
46+
<AdderText>{adderText}</AdderText>
3947
</AdderWrapper>
4048
</Label>
4149
<Divider/>
@@ -56,6 +64,7 @@ SectionLabel.propTypes = {
5664
node:PropTypes.oneOfType([PropTypes.string,PropTypes.node]),
5765
withAdder:PropTypes.bool,
5866
onAdd:PropTypes.func,
67+
adderText:PropTypes.string,
5968
}
6069

6170
SectionLabel.defaultProps={
@@ -64,6 +73,7 @@ SectionLabel.defaultProps = {
6473
node:'',
6574
withAdder:false,
6675
onAdd:debug,
76+
adderText:'添加',
6777
}
6878

6979
exportdefaultSectionLabel

‎components/SectionLabel/styles/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Title = styled.div`
1717
flex-grow: 1;
1818
`
1919
exportconstAdderWrapper=styled.div`
20-
margin-right:11%;
20+
margin-right:5%;
2121
display:${({ show})=>(show ?'flex' :'none')};
2222
&:active {
2323
animation:${Animate.pulse} 0.3s linear;
@@ -55,7 +55,7 @@ export const Divider = styled.div`
5555
border-color:${theme('banner.desc')};
5656
margin-top: 12px;
5757
margin-bottom: 18px;
58-
width:90%;
58+
width:95%;
5959
opacity: 0.3;
6060
`
6161

‎components/Tabber/index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const supportIcons = [
2626
'job',
2727
'cheatsheet',
2828
// user tab
29-
'posts',
29+
'publish',
30+
'billing',
31+
'comments',
3032
'settings',
3133
'likes',
3234
'favorites',

‎components/ThreadSelector/Panel.js‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
importReactfrom'react'
2+
3+
importDotDividerfrom'../DotDivider'
4+
import{Wrapper,Item,DotWrapper}from'./styles/panel'
5+
import{uid,Trans}from'../../utils'
6+
7+
constPanel=({ options, active, onSelect})=>(
8+
<Wrapper>
9+
{options.map(thread=>(
10+
<Itemkey={uid.gen()}onClick={onSelect.bind(this,thread)}>
11+
<div>{Trans(thread)}</div>
12+
<DotWrapperactive={thread===active}>
13+
<DotDivider/>
14+
</DotWrapper>
15+
</Item>
16+
))}
17+
</Wrapper>
18+
)
19+
20+
exportdefaultPanel

‎components/ThreadSelector/index.js‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
*
3+
* ThreadSelector
4+
*
5+
*/
6+
7+
importReactfrom'react'
8+
importPropTypesfrom'prop-types'
9+
10+
import{ICON_CMD}from'../../config'
11+
12+
importPopoverfrom'../Popover'
13+
import{Label,LabelIcon,LabelText}from'./styles'
14+
importPanelfrom'./Panel'
15+
16+
import{makeDebugger,THREAD,Trans}from'../../utils'
17+
/* eslint-disable no-unused-vars */
18+
constdebug=makeDebugger('c:ThreadSelector:index')
19+
/* eslint-enable no-unused-vars */
20+
21+
constThreadSelector=({ options, active, onSelect})=>(
22+
<Popover
23+
placement="bottom"
24+
trigger="hover"
25+
content={<Paneloptions={options}active={active}onSelect={onSelect}/>}
26+
>
27+
<Label>
28+
<LabelText>{Trans(active)}</LabelText>
29+
<LabelIconsrc={`${ICON_CMD}/thread_more.svg`}/>
30+
</Label>
31+
</Popover>
32+
)
33+
34+
ThreadSelector.propTypes={
35+
options:PropTypes.arrayOf(PropTypes.string),
36+
active:PropTypes.string,
37+
onSelect:PropTypes.func,
38+
}
39+
40+
ThreadSelector.defaultProps={
41+
options:[THREAD.POST,THREAD.VIDEO,THREAD.REPO,THREAD.JOB],
42+
active:THREAD.POST,
43+
onSelect:debug,
44+
}
45+
46+
exportdefaultThreadSelector
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
importstyledfrom'styled-components'
2+
3+
importImgfrom'../../Img'
4+
import{theme}from'../../../utils'
5+
6+
exportconstWrapper=styled.div`
7+
display: flex;
8+
`
9+
exportconstLabel=styled.div`
10+
display: flex;
11+
align-items: center;
12+
cursor: pointer;
13+
`
14+
exportconstLabelIcon=styled(Img)`
15+
width: 18px;
16+
height: 18px;
17+
fill:${theme('banner.title')};
18+
display: block;
19+
&:hover {
20+
fill:${theme('tabs.headerActive')};
21+
}
22+
`
23+
exportconstLabelText=styled.div`
24+
font-size: 0.9rem;
25+
`
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
importstyledfrom'styled-components'
2+
3+
// import { Img } from '../../../components'
4+
import{theme}from'../../../utils'
5+
6+
exportconstWrapper=styled.div`
7+
padding: 5px 12px;
8+
padding-top: 12px;
9+
display: flex;
10+
flex-direction: column;
11+
justify-content: center;
12+
`
13+
exportconstItem=styled.div`
14+
display: flex;
15+
align-items: center;
16+
color:${theme('thread.articleTitle')};
17+
margin-bottom: 8px;
18+
&:hover {
19+
font-weight: bold;
20+
cursor: pointer;
21+
}
22+
`
23+
exportconstDotWrapper=styled.div`
24+
display:${({ active})=>(active ?'block' :'none')};
25+
`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp