-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(voice recognition): added Voice Recognition component
- Loading branch information
Showing
5 changed files
with
85 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import TextToSpeechInit from './TextToSpeechInit'; | ||
import TextToSpeechStart from './TextToSpeechStart'; | ||
import TextToSpeechStop from './TextToSpeechStop'; | ||
import TextToSpeechInit from './TextToSpeechInit'; | ||
|
||
export { | ||
TextToSpeechInit, | ||
TextToSpeechStart, | ||
TextToSpeechStop, | ||
TextToSpeechInit, | ||
}; | ||
|
||
export default { | ||
Init: TextToSpeechInit, | ||
Start: TextToSpeechStart, | ||
Stop: TextToSpeechStop, | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import VoiceRecognition from './VoiceRecognitionInit'; | ||
import VoiceRecognitionInit from './VoiceRecognitionInit'; | ||
import VoiceRecognitionIcon from './VoiceRecognitionIcon'; | ||
import VoiceRecognitionModal from './VoiceRecognitionModal'; | ||
|
||
export { | ||
VoiceRecognition, | ||
VoiceRecognitionInit, | ||
VoiceRecognitionIcon, | ||
VoiceRecognitionModal, | ||
}; | ||
|
||
export default { | ||
Init: VoiceRecognitionInit, | ||
Icon: VoiceRecognitionIcon, | ||
Modal: VoiceRecognitionModal, | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
import React from 'react'; | ||
|
||
export default function VoiceRecognitionModal() { | ||
return ( | ||
<div>VoiceRecognitionModal</div> | ||
); | ||
export default function VoiceRecognitionModal({ | ||
children, | ||
isModalVisible, | ||
isVoiceStarted, | ||
onClose, | ||
voiceText, | ||
}) { | ||
let isReactElement = true; | ||
return isModalVisible && React.Children.map(children, (child) => { | ||
isReactElement = child.type[0] === child.type[0].toUpperCase(); | ||
return React.cloneElement(typeof child === 'string' ? <span>{child}</span> : child, { | ||
onClose, | ||
[isReactElement ? 'voiceText' : 'voicetext']: voiceText, | ||
[isReactElement ? 'isVoiceStarted' : 'isvoicestarted']: isVoiceStarted.toString(), | ||
}); | ||
}); | ||
} |