functional application without amazon update
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import {Button} from 'react-md';
|
||||
import '../css/Intent.css'
|
||||
import {INTENT_TITLE_MAX_LENGTH, INTENT_TITLE_TOOLTIP_DELAY} from '../config'
|
||||
|
||||
class IntentItem extends Component {
|
||||
|
||||
@@ -11,18 +12,18 @@ class IntentItem extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
/*
|
||||
<div className={this.props.selectedIndex===this.state.index ? 'IntentItem-selected' : 'IntentItem'} onClick={()=>{this.state.onClick(this.state.intent,this.state.index)}}>
|
||||
<Button className={"IntentItem"} flat swapTheming>OK</Button>
|
||||
<p> {this.state.index+1}. {this.state.intent.questions[0]} </p>
|
||||
</div>
|
||||
*/
|
||||
let buttonTitle = this.state.intent.intentName;
|
||||
if (buttonTitle.length > INTENT_TITLE_MAX_LENGTH){
|
||||
buttonTitle = this.state.intent.intentName.substr(0,INTENT_TITLE_MAX_LENGTH-1) + '. . .';
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<Button className={this.props.selectedIndex===this.state.index ? 'IntentItem-selected' : 'IntentItem'}
|
||||
onClick={()=>{this.state.onClick(this.state.intent,this.state.index)}}
|
||||
flat>
|
||||
{this.state.index+1}. {this.state.intent.questions[0]}
|
||||
flat
|
||||
tooltipDelay={INTENT_TITLE_TOOLTIP_DELAY}
|
||||
tooltipLabel={this.state.intent.questions[0].length>INTENT_TITLE_MAX_LENGTH ? this.state.intent.questions[0] : ''}>
|
||||
{this.state.index+1}. {buttonTitle}
|
||||
</Button>
|
||||
<br></br>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user