@@ -5,21 +5,73 @@ import { Heading } from 'native-base';
5
5
6
6
import { ListTile } from '../components/ListTile' ;
7
7
import { Screen } from '../components/Screen' ;
8
+ import { Switch } from 'react-native' ;
9
+ import { PlatformListTile } from '../components/PlatformListTile' ;
8
10
9
11
export const RepliesScreen : React . FC = ( ) => {
10
12
const [ count , setCount ] = useState < number > ( ) ;
13
+ const [ isNotificationEnable , setIsNotificationEnable ] = useState < boolean > ( true ) ;
14
+ const [ isPushNotificationEnable , setIsPushNotificationsEnable ] = useState < boolean > ( true ) ;
15
+ const [ isAppReplayNotificationSoundEnable , setIsAppReplayNotificationSoundEnable ] =
16
+ useState < boolean > ( false ) ;
17
+ const [ isSystemReplayNotificationSound , setIsSystemReplayNotificationSound ] =
18
+ useState < boolean > ( false ) ;
11
19
12
20
useEffect ( ( ) => {
13
- Replies . getUnreadRepliesCount ( setCount ) ;
21
+ Replies . getUnreadRepliesCount ( ) . then ( ( unReadCount ) => {
22
+ setCount ( unReadCount ) ;
23
+ } ) ;
14
24
} , [ ] ) ;
15
25
16
26
return (
17
27
< Screen >
28
+ < ListTile title = "Enable notification" >
29
+ < Switch
30
+ value = { isNotificationEnable }
31
+ onValueChange = { ( value ) => {
32
+ setIsNotificationEnable ( value ) ;
33
+ Replies . setEnabled ( value ) ;
34
+ } }
35
+ />
36
+ </ ListTile >
37
+ < ListTile title = "InApp Replay notification Sound" >
38
+ < Switch
39
+ value = { isAppReplayNotificationSoundEnable }
40
+ onValueChange = { ( value ) => {
41
+ setIsAppReplayNotificationSoundEnable ( value ) ;
42
+ Replies . setInAppNotificationSound ( value ) ;
43
+ } }
44
+ />
45
+ </ ListTile >
46
+ < PlatformListTile title = "System replay notification Sound" platform = "android" >
47
+ < Switch
48
+ value = { isSystemReplayNotificationSound }
49
+ onValueChange = { ( value ) => {
50
+ setIsSystemReplayNotificationSound ( value ) ;
51
+ Replies . setSystemReplyNotificationSoundEnabledAndroid ( value ) ;
52
+ } }
53
+ />
54
+ </ PlatformListTile >
55
+ < PlatformListTile title = "Push notification enable" platform = "android" >
56
+ < Switch
57
+ value = { isPushNotificationEnable }
58
+ onValueChange = { ( value ) => {
59
+ setIsPushNotificationsEnable ( value ) ;
60
+ Replies . setPushNotificationsEnabled ( value ) ;
61
+ } }
62
+ />
63
+ </ PlatformListTile >
18
64
< ListTile title = "Unread Messages" >
19
65
< Heading size = "sm" textAlign = "right" >
20
66
{ count ?? '...' }
21
67
</ Heading >
22
68
</ ListTile >
69
+ < ListTile
70
+ title = "Show conversion list"
71
+ onPress = { ( ) => {
72
+ Replies . show ( ) ;
73
+ } }
74
+ />
23
75
</ Screen >
24
76
) ;
25
77
} ;
0 commit comments