Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/app/pages/Components/FlipPanel/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ props.currentLocale = 'en-US';
props.formatPhone = () => null;
props.hideFlipPanel = () => null;
props.flip = () => null;
props.hangup = () => null;
props.complete = () => null;

/**
* A example of `FlipPanel`
Expand Down
2 changes: 1 addition & 1 deletion src/components/CallCtrlPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CallCtrlPanel extends Component {
formatPhone={this.props.formatPhone}
hideFlipPanel={this.hideFlipPanel}
flip={this.props.flip}
hangup={this.props.hangup}
complete={this.props.hangup}
/>
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/FlipPanel/i18n/en-US.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export default {
flipHeader: 'Flip call to...',
flip: 'Flip',
complete: 'Complete Flip',
};
18 changes: 9 additions & 9 deletions src/components/FlipPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class FlipPanel extends Component {
super(props);
this.state = {
flipValue: this.props.flipNumbers.length === 0 ? '' : this.props.flipNumbers[0].phoneNumber,
flipEnabled: true,
flipEnabled: !this.props.isOnFlip,
};
this.onRadioSelect = (value) => {
this.setState({
Expand All @@ -25,7 +25,7 @@ export default class FlipPanel extends Component {
this.flip = () => {
this.props.flip(this.state.flipValue);
this.setState({
flipEnabled: false
flipEnabled: false,
});
};
}
Expand Down Expand Up @@ -55,7 +55,7 @@ export default class FlipPanel extends Component {
onRadioSelect={this.onRadioSelect}
/>
<div className={styles.buttonGroup}>
<div className={styles.button}>
<div className={styles.button} title={i18n.getString('flip', this.props.currentLocale)}>
<CircleButton
className={this.state.flipEnabled ? styles.flipButton : styles.buttonDisabled}
iconClassName={styles.flipIcon}
Expand All @@ -64,13 +64,13 @@ export default class FlipPanel extends Component {
showBorder
/>
</div>
<div className={styles.button}>
<div className={styles.button} title={i18n.getString('complete', this.props.currentLocale)}>
<CircleButton
className={styles.hangupButton}
iconClassName={styles.hangupIcon}
onClick={this.props.hangup}
className={this.props.isOnFlip ? styles.completeButton : styles.buttonDisabled}
iconClassName={this.props.isOnFlip ? styles.completeIcon : ''}
onClick={this.props.isOnFlip ? this.props.complete : () => {}}
icon={EndIcon}
showBorder={false}
showBorder
/>
</div>
</div>
Expand All @@ -87,5 +87,5 @@ FlipPanel.propTypes = {
formatPhone: PropTypes.func.isRequired,
hideFlipPanel: PropTypes.func.isRequired,
flip: PropTypes.func.isRequired,
hangup: PropTypes.func.isRequired,
complete: PropTypes.func.isRequired,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update FlipPanel's demo code in docs.

};
4 changes: 2 additions & 2 deletions src/components/FlipPanel/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}
}

.hangupButton {
.completeButton {
circle {
fill: #0073ae;
opacity: 0.45;
Expand All @@ -79,7 +79,7 @@
}
}

.hangupIcon {
.completeIcon {
path {
fill: $line-background-color
}
Expand Down