Simplified to function component
This commit is contained in:
parent
4e712cadbf
commit
f186ff8109
|
@ -1,11 +1,26 @@
|
|||
import React, { Component } from 'preact/compat';
|
||||
import React from 'preact/compat';
|
||||
import Select from 'react-select';
|
||||
|
||||
export const purposes = [{'value': 'assessing', 'label': 'Assessing'}, {'value': 'bookmarking', 'label': 'Bookmarking'}, {'value': 'classifying', 'label': 'Classifying'}, {'value': 'commenting', 'label': 'Commenting'}, {'value': 'describing', 'label': 'Describing'},{'value': 'editing', 'label': 'Editing'}, {'value': 'highlighting', 'label': 'Highlighting'},{'value': 'identifying', 'label': 'Identifying'},{'value': 'linking', 'label': 'Linking'},{'value': 'moderating', 'label': 'Moderating'},{'value': 'questioning', 'label': 'Questioning'},{'value': 'replying', 'label': 'Replying'}]
|
||||
export const purposes = [
|
||||
{'value': 'assessing', 'label': 'Assessing'},
|
||||
{'value': 'bookmarking', 'label': 'Bookmarking'},
|
||||
{'value': 'classifying', 'label': 'Classifying'},
|
||||
{'value': 'commenting', 'label': 'Commenting'},
|
||||
{'value': 'describing', 'label': 'Describing'},
|
||||
{'value': 'editing', 'label': 'Editing'},
|
||||
{'value': 'highlighting', 'label': 'Highlighting'},
|
||||
{'value': 'identifying', 'label': 'Identifying'},
|
||||
{'value': 'linking', 'label': 'Linking'},
|
||||
{'value': 'moderating', 'label': 'Moderating'},
|
||||
{'value': 'questioning', 'label': 'Questioning'},
|
||||
{'value': 'replying', 'label': 'Replying'}
|
||||
]
|
||||
|
||||
const PurposeDropdown = props => {
|
||||
|
||||
const selectedOption = this.props.content ?
|
||||
{ 'value': this.props.content, 'label': this.props.content.charAt(0).toUpperCase() + this.props.content.slice(1) } : undefined;
|
||||
|
||||
export default class PurposeDropdown extends Component {
|
||||
render() {
|
||||
const selectedOption = this.props.content ? {'value': this.props.content, 'label': this.props.content.charAt(0).toUpperCase() + this.props.content.slice(1) } : undefined;
|
||||
return (
|
||||
<div class="r6o-purposedropdown">
|
||||
<Select
|
||||
|
@ -16,5 +31,7 @@ export default class PurposeDropdown extends Component {
|
|||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default PurposeDropdown;
|
Loading…
Reference in New Issue