Skip to content

Commit

Permalink
update example so user can close and reopen chat window
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Holohan committed Aug 3, 2020
1 parent 69be7a7 commit a577379
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://www.jitpack.io" }
}

dependencies {
Expand Down Expand Up @@ -55,7 +55,7 @@ repositories {
mavenCentral()
jcenter()
google()
maven { url "https://jitpack.io" }
maven { url "https://www.jitpack.io" }

def found = false
def defaultDir = null
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ PODS:
- React-cxxreact (= 0.62.0)
- React-jsi (= 0.62.0)
- React-jsinspector (0.62.0)
- react-native-crisp-chat-sdk (0.1.2):
- react-native-crisp-chat-sdk (0.1.3):
- Crisp (= 0.1.30)
- React
- React-RCTActionSheet (0.62.0):
Expand Down Expand Up @@ -433,7 +433,7 @@ SPEC CHECKSUMS:
React-jsi: bc8166d6833cdcb0848c80710b26ce63fad2c099
React-jsiexecutor: 8bf0b2707f05865113415088c398a7f98c0cf546
React-jsinspector: 8e5913c4c6c54f0d3f9c9fc630c465a89cded65d
react-native-crisp-chat-sdk: 6955b7238331e7c9ddfcd65d47eb4ee69785be80
react-native-crisp-chat-sdk: c3a6f95433bc329007f9c81eb88cb79b1ca8a58c
React-RCTActionSheet: 674afbc8b9c76e0a83520e0a51da29a70802c03f
React-RCTAnimation: f5f24330d09ee677fb49e0782f8321868f4df431
React-RCTBlob: b773ce6138ab0d172ebd8a455fd4efd200a92549
Expand Down
6 changes: 3 additions & 3 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
import { CrispChatSDK, CrispChatUI } from 'react-native-crisp-chat-sdk';

export default function App() {
const [showChat, setShowChat] = React.useState<boolean>();
const [showChat, setShowChat] = React.useState<boolean>(false);

React.useEffect(() => {
CrispChatSDK.setUserEmail('[email protected]');
}, []);

return (
<View style={styles.container}>
<TouchableOpacity onPress={() => setShowChat(true)}>
<Text>Show Chat</Text>
<TouchableOpacity onPress={() => setShowChat(!showChat)}>
<Text>{showChat ? 'Hide' : 'Show'} Chat</Text>
</TouchableOpacity>
{showChat && <CrispChatUI style={{ flex: 1, width: '100%' }} />}
</View>
Expand Down

0 comments on commit a577379

Please sign in to comment.