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.

Commitc9eca37

Browse files
committed
refactor(jobviewer): ui: add homepage link & popver .. etc
1 parentce3a663 commitc9eca37

File tree

5 files changed

+57
-11
lines changed

5 files changed

+57
-11
lines changed

‎components/ArticleHeader/CompanyInfo.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
importReactfrom'react'
22
importTimeAgofrom'timeago-react'
33

4+
import{ICON_CMD}from'../../config'
5+
46
import{DotDivider}from'..'
57

68
import{
@@ -9,6 +11,9 @@ import {
911
Title,
1012
PublishAt,
1113
Username,
14+
HomtPage,
15+
HomeIcon,
16+
HomepageLink,
1217
}from'./styles/company_info'
1318

1419
import{cutFrom}from'../../utils'
@@ -18,6 +23,16 @@ const CompanyInfo = ({ company, insertedAt, author }) => (
1823
<Logosrc={company.logo}alt="user_avatar"/>
1924
<div>
2025
<Title>{cutFrom(company.title,14)}</Title>
26+
<HomtPage>
27+
<HomeIconsrc={`${ICON_CMD}/home.svg`}/>
28+
<HomepageLink
29+
href="https://github.com"
30+
rel="noopener noreferrer"
31+
target="_blank"
32+
>
33+
https://github.com/mydearxym
34+
</HomepageLink>
35+
</HomtPage>
2136
<PublishAt>
2237
<Username>{author.nickname}</Username>
2338
<DotDivider/>

‎components/ArticleHeader/styles/company_info.js‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ export const Title = styled.div`
1414
color:${theme('thread.articleTitle')};
1515
margin-top: 2px;
1616
`
17+
exportconstHomtPage=styled.div`
18+
display: flex;
19+
align-items: center;
20+
`
21+
exportconstHomeIcon=styled(Img)`
22+
fill:${theme('thread.articleDigest')};
23+
width: 15px;
24+
height: 15px;
25+
display: block;
26+
`
27+
exportconstHomepageLink=styled.a`
28+
color:${theme('thread.articleDigest')};
29+
margin-left: 3px;
30+
&:hover {
31+
text-decoration: underline;
32+
color:${theme('thread.articleTitle')};
33+
}
34+
`
1735
exportconstUsername=styled.div`
1836
font-size: 0.9rem;
1937
`
@@ -25,7 +43,7 @@ export const PublishAt = styled.div`
2543
`
2644
exportconstLogo=styled(Img)`
2745
border-radius: 3px;
28-
width:44px;
29-
height:44px;
30-
margin-right:10px;
46+
width:64px;
47+
height:64px;
48+
margin-right:12px;
3149
`

‎containers/Labeler/Selected.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import R from 'ramda'
33

44
import{Maybe}from'../../components'
55
import{Wrapper,Item,Hightlight}from'./styles/selected'
6+
import{uid}from'../../utils'
67

78
constrenderItems=items=>{
89
if(items.length===1){
@@ -31,7 +32,9 @@ const renderReadonlyItems = items => {
3132

3233
return(
3334
<Item>
34-
<Hightlight>{items[0]}, ..</Hightlight>
35+
{items.map(item=>(
36+
<Hightlightkey={uid.gen()}>{item}</Hightlight>
37+
))}
3538
</Item>
3639
)
3740
}

‎containers/Labeler/index.js‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { inject, observer } from 'mobx-react'
1212
import{Popover,Maybe}from'../../components'
1313
importOptionsfrom'./Options'
1414
importSelectedfrom'./Selected'
15-
import{Wrapper,LabelItem,LabelIcon,Title}from'./styles'
15+
import{Wrapper,LabelItem,LabelIcon,Title,PopHint}from'./styles'
1616

1717
importoptionMapfrom'./option_map'
1818
import{makeDebugger,storePlug,uid}from'../../utils'
@@ -64,12 +64,18 @@ class LabelerContainer extends React.Component {
6464
return(
6565
<Wrapper>
6666
<Maybetest={readonly}>
67-
<LabelItem>
68-
<LabelIconsrc={optionMap[label].iconSrc}/>
69-
<Title>
70-
<Selecteditems={selected}readonly={readonly}/>
71-
</Title>
72-
</LabelItem>
67+
<Popover
68+
content={<PopHint>{trans[label]}</PopHint>}
69+
placement="bottom"
70+
trigger="hover"
71+
>
72+
<LabelItem>
73+
<LabelIconsrc={optionMap[label].iconSrc}/>
74+
<Title>
75+
<Selecteditems={selected}readonly={readonly}/>
76+
</Title>
77+
</LabelItem>
78+
</Popover>
7379
</Maybe>
7480
<Maybetest={!readonly}>
7581
{targetIndex>=0 ?(

‎containers/Labeler/styles/index.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ export const Title = styled.div`
3434
color:${theme('editor.footerHover')};
3535
}
3636
`
37+
exportconstPopHint=styled.div`
38+
padding: 5px 8px;
39+
color:${theme('thread.articleDigest')};
40+
`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp