Skip to content

Commit

Permalink
fix for List and HOC: ant-design/ant-design#4853
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLaux committed Jan 21, 2018
1 parent 1162aff commit 9d75da8
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions app/components/TokenChooserList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ selectedTokens={[]}
onTokenToggle={(x) => console.log(x)}
*/

const LeftList = styled(List) `
const LeftDiv = styled.div`
.ant-list-item-meta-content{
text-align:left;
}
Expand All @@ -25,19 +25,21 @@ const LeftList = styled(List) `
function TokenChooserList(props) {
const { tokenList, chosenTokens, onTokenToggle } = props;
return (
<LeftList
itemLayout="horizontal"
dataSource={tokenList}
renderItem={(item) => (
<List.Item actions={[<Switch checked={chosenTokens[item.symbol]} onChange={(toggle) => onTokenToggle(item.symbol, toggle)} />]}>
<List.Item.Meta
avatar={<TokenIcon tokenSymbol={item.symbol} size={32} />}
title={<a href={item.url} target="_blank" rel="noopener">{item.name} ({item.symbol.toUpperCase()})</a>}
description={item.description}
/>
</List.Item>
)}
/>
<LeftDiv>
<List
itemLayout="horizontal"
dataSource={tokenList}
renderItem={(item) => (
<List.Item actions={[<Switch checked={chosenTokens[item.symbol]} onChange={(toggle) => onTokenToggle(item.symbol, toggle)} />]}>
<List.Item.Meta
avatar={<TokenIcon tokenSymbol={item.symbol} size={32} />}
title={<a href={item.url} target="_blank" rel="noopener">{item.name} ({item.symbol.toUpperCase()})</a>}
description={item.description}
/>
</List.Item>
)}
/>
</LeftDiv>
);
}

Expand Down

0 comments on commit 9d75da8

Please sign in to comment.