Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pianoApp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
norhalimah
pianoApp
Commits
ebca5454
Commit
ebca5454
authored
Jan 13, 2021
by
norhalimah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
417899a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
41 deletions
+21
-41
quiz.js
screens/quiz.js
+21
-4
saveRecords.js
screens/saveRecords.js
+0
-37
No files found.
screens/quiz.js
View file @
ebca5454
...
@@ -784,9 +784,10 @@ this.setState({records: []});
...
@@ -784,9 +784,10 @@ this.setState({records: []});
SbuttonB41
,
SbuttonB41
,
SbuttonB51
,
SbuttonB51
,
}
=
styles
;
}
=
styles
;
const
CorrectAlertBox
=
()
=>
{
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showC
}
>
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showC
}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
<
View
style
=
{{
style
=
{{
...
@@ -814,8 +815,12 @@ this.setState({records: []});
...
@@ -814,8 +815,12 @@ this.setState({records: []});
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
);
};
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showW
}
>
const
WrongAlertBox
=
()
=>
{
return
(
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showW
}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
<
View
style
=
{{
style
=
{{
...
@@ -843,8 +848,12 @@ this.setState({records: []});
...
@@ -843,8 +848,12 @@ this.setState({records: []});
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
);
};
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showDone
}
>
const
DoneAlertBox
=
()
=>
{
return
(
<
Modal
transparent
=
{
true
}
visible
=
{
this
.
state
.
showDone
}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
style
=
{{
backgroundColor
:
'#000000aa'
,
flex
:
1
}}
>
<
View
<
View
style
=
{{
style
=
{{
...
@@ -874,6 +883,14 @@ this.setState({records: []});
...
@@ -874,6 +883,14 @@ this.setState({records: []});
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/Modal
>
<
/Modal
>
);
};
return
(
<
View
style
=
{
styles
.
container
}
>
<
CorrectAlertBox
/>
<
WrongAlertBox
/>
<
DoneAlertBox
/>
<
StatusBar
hidden
/>
<
StatusBar
hidden
/>
<
View
style
=
{
styles
.
c1
}
>
<
View
style
=
{
styles
.
c1
}
>
<
View
style
=
{
styles
.
cc1
}
>
<
View
style
=
{
styles
.
cc1
}
>
...
...
screens/saveRecords.js
deleted
100644 → 0
View file @
417899a7
/* 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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment