Commit ebca5454 authored by norhalimah's avatar norhalimah

...

parent 417899a7
......@@ -784,8 +784,9 @@ this.setState({records: []});
SbuttonB41,
SbuttonB51,
} = styles;
const CorrectAlertBox = () =>{
return (
<View style={styles.container}>
<Modal transparent={true} visible={this.state.showC}>
<View style={{backgroundColor: '#000000aa', flex: 1}}>
<View
......@@ -814,7 +815,11 @@ this.setState({records: []});
</View>
</View>
</Modal>
);
};
const WrongAlertBox = () =>{
return (
<Modal transparent={true} visible={this.state.showW}>
<View style={{backgroundColor: '#000000aa', flex: 1}}>
<View
......@@ -843,7 +848,11 @@ this.setState({records: []});
</View>
</View>
</Modal>
);
};
const DoneAlertBox = () =>{
return (
<Modal transparent={true} visible={this.state.showDone}>
<View style={{backgroundColor: '#000000aa', flex: 1}}>
<View
......@@ -874,6 +883,14 @@ this.setState({records: []});
</View>
</View>
</Modal>
);
};
return (
<View style={styles.container}>
<CorrectAlertBox />
<WrongAlertBox />
<DoneAlertBox />
<StatusBar hidden />
<View style={styles.c1}>
<View style={styles.cc1}>
......
/* eslint-disable prettier/prettier */
import { Component } from 'react';
import moment from 'moment';
import AsyncStorage from '@react-native-async-storage/async-storage';
const date = moment().utcOffset('+08:00').format('D MMM');
const time = moment().utcOffset('+08:00').format('h:mm a');
const day = moment().utcOffset('+08:00').format('ddd');
//var records = [];
class OtherClass extends Component {
saveRecord = async (correct, wrong, stime) => {
let obj = {
correct: correct,
wrong: wrong,
timer: stime,
date: date,
time: time,
day : day,
};
try {
const value = await AsyncStorage.getItem('@storage_key');
if (value !== null) {
// We have data!!
// console.log(JSON.parse(value));
this.setState({ logbook: JSON.parse(value) });
console.log(this.state.logbook.length);
}
} catch (error) {
// Error retrieving data
}
};
}
export default OtherClass;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment