-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add home and Siri button for iOS devices
- Loading branch information
1 parent
3e46948
commit 92cc81e
Showing
11 changed files
with
178 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { Component } from 'react'; | ||
import { Modal, Button, Input, Row } from 'antd'; | ||
import { hideSiriCommandModal, setSiriCommandValue } from '../../actions/Inspector'; | ||
import InspectorStyles from './Inspector.css'; | ||
import { withTranslation } from '../../util'; | ||
|
||
class SiriCommandModal extends Component { | ||
|
||
onSubmit () { | ||
const { | ||
siriCommandValue, | ||
hideSiriCommandModal, | ||
applyClientMethod | ||
} = this.props; | ||
applyClientMethod({ methodName: 'executeScript', args: ['mobile:siriCommand', [{text: siriCommandValue}]]}); | ||
hideSiriCommandModal(); | ||
} | ||
|
||
onCancel () { | ||
const {hideSiriCommandModal} = this.props; | ||
hideSiriCommandModal(); | ||
} | ||
|
||
render () { | ||
const { | ||
siriCommandValue, | ||
setSiriCommandValue, | ||
isSiriCommandModalVisible, | ||
t, | ||
} = this.props; | ||
|
||
// Footer displays all the buttons at the bottom of the Modal | ||
return <Modal visible={isSiriCommandModalVisible} | ||
title={t('Execute Siri Command')} | ||
onCancel={this.onCancel.bind(this)} | ||
footer= | ||
{[ | ||
<Button onClick={this.onSubmit.bind(this)} type="primary">Execute command</Button> | ||
]}> | ||
<Row> | ||
{t('Command')} | ||
<Input.TextArea onChange={(e) => setSiriCommandValue(e.target.value)} value={siriCommandValue} /> | ||
</Row> | ||
</Modal>; | ||
} | ||
} | ||
|
||
export default withTranslation(SiriCommandModal); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.