Skip to content

Commit

Permalink
Combined ChatGPT and DallE
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammy970 committed Jun 3, 2023
1 parent cceabbe commit b858e92
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ export default function App() {
const [messages, setMessages] = useState([]);

const handleButtonClick = () => {
console.log(inputMessage)
if (inputMessage.toLocaleLowerCase().startsWith("generate image")) {
generateImages();
} else {
generateText();
}
}

const generateText = () => {

console.log(inputMessage)

Expand Down Expand Up @@ -134,7 +143,7 @@ export default function App() {
<TextInput placeholder='Enter your Question' onChangeText={setInputMessage} />
</View>

<TouchableOpacity onPress={generateImages}>
<TouchableOpacity onPress={handleButtonClick}>
<View style={{
backgroundColor: 'green', padding: 5, marginRight: 10, marginBottom: 20,
borderRadius: 9999, width: 60, height: 60,
Expand Down

0 comments on commit b858e92

Please sign in to comment.