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 1, 2021. It is now read-only.

Commit40bc04f

Browse files
committed
feat(usersTable): add social cell
1 parent1510053 commit40bc04f

File tree

4 files changed

+72
-3
lines changed

4 files changed

+72
-3
lines changed

‎components/SocialSell/index.js‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
*
3+
* SocialSell
4+
*
5+
*/
6+
7+
importReactfrom'react'
8+
importPropTypesfrom'prop-types'
9+
importRfrom'ramda'
10+
11+
import{ICON_CMD}from'config'
12+
import{makeDebugger}from'utils'
13+
14+
import{Wrapper,SocalIcon}from'./styles'
15+
16+
/* eslint-disable-next-line */
17+
constdebug=makeDebugger('c:SocialSell:index')
18+
19+
constSocialSell=({ data})=>{
20+
constvalidList=[]
21+
22+
R.forEachObjIndexed((v,k)=>{
23+
if(v){
24+
validList.push({social:k,value:v})
25+
}
26+
},data)
27+
28+
return(
29+
<Wrapper>
30+
{validList.map(item=>(
31+
<divkey={item.social}>
32+
<ahref={item.value}target="_blank"rel="noopener noreferrer">
33+
<SocalIconsrc={`${ICON_CMD}/${item.social}.svg`}/>
34+
</a>
35+
</div>
36+
))}
37+
</Wrapper>
38+
)
39+
}
40+
41+
SocialSell.propTypes={
42+
data:PropTypes.object.isRequired,
43+
}
44+
45+
SocialSell.defaultProps={}
46+
47+
exportdefaultReact.memo(SocialSell)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
importstyledfrom'styled-components'
2+
3+
importImgfrom'Img'
4+
// import { theme } from '@utils'
5+
6+
exportconstWrapper=styled.div``
7+
exportconstTitle=styled.div``
8+
9+
exportconstSocalIcon=styled(Img)`
10+
width: 15px;
11+
height: 15px;
12+
display: block;
13+
`
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 SocialSell from '../index'
5+
6+
describe('TODO <SocialSell />',()=>{
7+
it('Expect to have unit tests specified',()=>{
8+
expect(true).toEqual(true)
9+
})
10+
})

‎components/UsersTable/index.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Pagi from '../Pagi'
1313
import{TableLoading}from'../LoadingEffects'
1414
importMaybeCellfrom'../MaybeCell'
1515
importUserCellfrom'../UserCell'
16+
importSocialSellfrom'../SocialSell'
1617
importTimeStampCellfrom'../TimeStampCell'
1718

1819
importPermissionCellfrom'../PermissionCell'
@@ -66,9 +67,7 @@ class UsersTable extends React.PureComponent {
6667
dataIndex:'social',
6768
align:'center',
6869
width:150,
69-
render:()=>{
70-
return<div>hello</div>
71-
},
70+
render:data=><SocialSelldata={data}/>,
7271
},
7372
{
7473
title:'关注社区',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp