uinz-swipe-option
v0.0.2
Published
<img src="https://cloud.githubusercontent.com/assets/12208108/25272728/921cbe36-26bb-11e7-9875-4d4ad22c2415.png" width="300" />
Downloads
2
Readme
oneline demo
class Example extends Component {
onSelect = (v, hide) => {
window.alert(v);
hide();
}
render () {
return (
<div className='demo-list'>
<style>{`
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
.swipe-wrap {
}
.demo-item {
line-height: 50px;
padding-left: 8px;
border-bottom: 1px solid #e9e9e9;
}
.demo-list .delete {
background-color: #f30;
color: #fff;
width: 100px;
}
`}</style>
{Array(30).fill(0).map((_, i) => {
const options = [
{label: `DELETE - ${i}`, className: 'delete', value: `DELETE - ${i}`}
];
if (i % 2) options.unshift({label: `OPT - ${i}`, className: '', value: `OPT - ${i}`});
return (
<SwipeOption key={i}
onSelect={this.onSelect}
options={options}
className='swipe-wrap'>
<div className='demo-item'>
List - {i}
</div>
</SwipeOption>
);
})}
</div>
);
}
}