You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.2 KiB
63 lines
1.2 KiB
7 years ago
|
import PropTypes from 'prop-types';
|
||
|
import React, { Component } from 'react';
|
||
|
import TableRowButton from 'Components/Table/TableRowButton';
|
||
|
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
||
|
import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
||
|
|
||
7 years ago
|
class SelectTrackRow extends Component {
|
||
7 years ago
|
|
||
|
//
|
||
|
// Listeners
|
||
|
|
||
|
onPress = () => {
|
||
|
const {
|
||
|
id,
|
||
|
isSelected
|
||
|
} = this.props;
|
||
|
|
||
|
this.props.onSelectedChange({ id, value: !isSelected });
|
||
|
}
|
||
|
|
||
|
//
|
||
|
// Render
|
||
|
|
||
|
render() {
|
||
|
const {
|
||
|
id,
|
||
7 years ago
|
trackNumber,
|
||
7 years ago
|
title,
|
||
|
isSelected,
|
||
|
onSelectedChange
|
||
|
} = this.props;
|
||
|
|
||
|
return (
|
||
|
<TableRowButton onPress={this.onPress}>
|
||
|
<TableSelectCell
|
||
|
id={id}
|
||
|
isSelected={isSelected}
|
||
|
onSelectedChange={onSelectedChange}
|
||
|
/>
|
||
|
|
||
|
<TableRowCell>
|
||
7 years ago
|
{trackNumber}
|
||
7 years ago
|
</TableRowCell>
|
||
|
|
||
|
<TableRowCell>
|
||
|
{title}
|
||
|
</TableRowCell>
|
||
|
|
||
|
</TableRowButton>
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
SelectTrackRow.propTypes = {
|
||
7 years ago
|
id: PropTypes.number.isRequired,
|
||
7 years ago
|
trackNumber: PropTypes.number.isRequired,
|
||
7 years ago
|
title: PropTypes.string.isRequired,
|
||
|
isSelected: PropTypes.bool,
|
||
|
onSelectedChange: PropTypes.func.isRequired
|
||
|
};
|
||
|
|
||
7 years ago
|
export default SelectTrackRow;
|