This commit is contained in:
Mekan1206
2026-06-02 12:36:04 +05:00
parent 3cac2d4051
commit 627f1246db
2 changed files with 24 additions and 5 deletions

View File

@@ -8,7 +8,8 @@
"scheme": "ugrat", "scheme": "ugrat",
"userInterfaceStyle": "automatic", "userInterfaceStyle": "automatic",
"ios": { "ios": {
"icon": "./assets/expo.icon" "icon": "./assets/expo.icon",
"bundleIdentifier": "com.nurmuhammet.ali.ugrat"
}, },
"android": { "android": {
"adaptiveIcon": { "adaptiveIcon": {

View File

@@ -4,7 +4,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import { Stack, router } from 'expo-router'; import { Stack, router } from 'expo-router';
import { useKeepAwake } from 'expo-keep-awake'; import { useKeepAwake } from 'expo-keep-awake';
import io from 'socket.io-client'; import io from 'socket.io-client';
import SendDirectSms from 'react-native-send-direct-sms'; import { SendDirectSms } from 'react-native-send-direct-sms';
export default function DashboardScreen() { export default function DashboardScreen() {
useKeepAwake(); // Keep the screen awake useKeepAwake(); // Keep the screen awake
@@ -108,7 +108,7 @@ export default function DashboardScreen() {
const targetPhone = data.phone || '+993 61 92 92 48'; const targetPhone = data.phone || '+993 61 92 92 48';
if (Platform.OS === 'android') { if (Platform.OS === 'android') {
SendDirectSms.sendDirectSms(targetPhone, data.message) SendDirectSms(targetPhone, data.message)
.then((res: any) => { .then((res: any) => {
addLog(`SMS sent successfully to ${targetPhone}`); addLog(`SMS sent successfully to ${targetPhone}`);
socket.emit('sms_status', { id: data.id, status: 'sent' }); socket.emit('sms_status', { id: data.id, status: 'sent' });
@@ -157,7 +157,12 @@ export default function DashboardScreen() {
</View> </View>
</View> </View>
<Text style={styles.logTitle}>Activity Log</Text> <View style={styles.logHeader}>
<Text style={styles.logTitle}>Activity Log</Text>
<TouchableOpacity onPress={() => setLogs([])} style={styles.clearButton}>
<Text style={styles.clearButtonText}>Clear</Text>
</TouchableOpacity>
</View>
<FlatList <FlatList
data={logs} data={logs}
keyExtractor={item => item.id} keyExtractor={item => item.id}
@@ -222,11 +227,24 @@ const styles = StyleSheet.create({
color: '#333', color: '#333',
fontWeight: '600', fontWeight: '600',
}, },
logHeader: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
paddingRight: 15,
marginBottom: 10,
},
clearButton: {
padding: 5,
},
clearButtonText: {
color: '#208AEF',
fontWeight: 'bold',
},
logTitle: { logTitle: {
fontSize: 18, fontSize: 18,
fontWeight: 'bold', fontWeight: 'bold',
marginLeft: 15, marginLeft: 15,
marginBottom: 10,
color: '#333', color: '#333',
}, },
logList: { logList: {