skuilder 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -12
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +35 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +70 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +35 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/prompts.d.ts +5 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +185 -0
- package/dist/utils/prompts.js.map +1 -0
- package/dist/utils/template.d.ts +26 -0
- package/dist/utils/template.d.ts.map +1 -0
- package/dist/utils/template.js +170 -0
- package/dist/utils/template.js.map +1 -0
- package/eslint.config.mjs +21 -0
- package/package.json +41 -36
- package/src/cli.ts +42 -0
- package/src/commands/init.ts +83 -0
- package/src/types.ts +72 -0
- package/src/utils/prompts.ts +204 -0
- package/src/utils/template.ts +215 -0
- package/tsconfig.json +12 -21
- package/.npmignore +0 -56
- package/android/app/BUCK +0 -65
- package/android/app/build.gradle +0 -139
- package/android/app/proguard-rules.pro +0 -66
- package/android/app/src/main/AndroidManifest.xml +0 -32
- package/android/app/src/main/java/com/rxphelloworld/MainActivity.java +0 -15
- package/android/app/src/main/java/com/rxphelloworld/MainApplication.java +0 -40
- package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/app/src/main/res/values/strings.xml +0 -3
- package/android/app/src/main/res/values/styles.xml +0 -8
- package/android/build.gradle +0 -24
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradle.properties +0 -20
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/android/keystores/BUCK +0 -8
- package/android/keystores/debug.keystore.properties +0 -4
- package/android/settings.gradle +0 -3
- package/img/fingerCounter/1.PNG +0 -0
- package/img/fingerCounter/10.PNG +0 -0
- package/img/fingerCounter/2.PNG +0 -0
- package/img/fingerCounter/3.PNG +0 -0
- package/img/fingerCounter/4.PNG +0 -0
- package/img/fingerCounter/5.PNG +0 -0
- package/img/fingerCounter/6.PNG +0 -0
- package/img/fingerCounter/7.PNG +0 -0
- package/img/fingerCounter/8.PNG +0 -0
- package/img/fingerCounter/9.PNG +0 -0
- package/index.android.js +0 -1
- package/index.html +0 -30
- package/index.ios.js +0 -1
- package/ios/RXPHelloWorld/AppDelegate.h +0 -16
- package/ios/RXPHelloWorld/AppDelegate.m +0 -37
- package/ios/RXPHelloWorld/Base.lproj/LaunchScreen.xib +0 -42
- package/ios/RXPHelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/ios/RXPHelloWorld/Info.plist +0 -56
- package/ios/RXPHelloWorld/main.m +0 -18
- package/ios/RXPHelloWorld.xcodeproj/project.pbxproj +0 -1251
- package/ios/RXPHelloWorld.xcodeproj/xcshareddata/xcschemes/RXPHelloWorld-tvOS.xcscheme +0 -129
- package/ios/RXPHelloWorld.xcodeproj/xcshareddata/xcschemes/RXPHelloWorld.xcscheme +0 -129
- package/ios/RXPHelloWorldTests/Info.plist +0 -24
- package/ios/RXPHelloWorldTests/RXPHelloWorldTests.m +0 -70
- package/src/App.tsx +0 -206
- package/src/appUtilities/Grader.ts +0 -72
- package/src/appUtilities/Keybinder.ts +0 -28
- package/src/appUtilities/Recorder.ts +0 -73
- package/src/cloudantFiles/_users._design._auth.validate_doc_update.js +0 -136
- package/src/components/ProgressChart.tsx +0 -155
- package/src/components/fingerCounter/fingerCounter.tsx +0 -38
- package/src/components/fingerCounter/resources/hands.svg +0 -512
- package/src/components/numpad.tsx +0 -146
- package/src/components/sessionReport.tsx +0 -87
- package/src/index.tsx +0 -8
- package/src/questions/addition.tsx +0 -30
- package/src/questions/division.tsx +0 -62
- package/src/questions/multiplication.tsx +0 -71
- package/src/styles/answerStyles.css +0 -22
- package/src/typings/react.d.ts +0 -964
- package/webpack.config.ts +0 -26
- package/yarn.lock +0 -6208
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { QuestionRecord } from '../skuilder-base/BaseClasses'
|
|
2
|
-
import * as pouch from 'pouchdb-browser'
|
|
3
|
-
// import * as auth from 'pouchdb-authentication'
|
|
4
|
-
|
|
5
|
-
pouch.plugin(require('pouchdb-authentication'))
|
|
6
|
-
|
|
7
|
-
const auth = require('pouchdb-authentication');
|
|
8
|
-
|
|
9
|
-
const key = 'record';
|
|
10
|
-
const localDB: PouchDB.Database<PouchDB.Core.Encodable> = new pouch(key);
|
|
11
|
-
const remoteDB: PouchDB.Database<PouchDB.Core.Encodable> = new pouch(
|
|
12
|
-
'https://' +
|
|
13
|
-
'nilock.cloudant.com/' +
|
|
14
|
-
key, {
|
|
15
|
-
skip_setup: true
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
localDB.sync(remoteDB, {
|
|
20
|
-
live: true,
|
|
21
|
-
retry: true
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// works - need a login/register page. Still waiting on per-user dbs
|
|
26
|
-
// remoteDB.signup('newUser', 'password', function (err, resp) {
|
|
27
|
-
// if (err) {
|
|
28
|
-
// console.log("Signup error:" + err.name);
|
|
29
|
-
// } else {
|
|
30
|
-
// console.log("Signup success!" + resp.name);
|
|
31
|
-
// }
|
|
32
|
-
// })
|
|
33
|
-
|
|
34
|
-
export default class Recorder {
|
|
35
|
-
private static localDB: PouchDB.Database<PouchDB.Core.Encodable> = localDB;
|
|
36
|
-
private static remoteDB: PouchDB.Database<PouchDB.Core.Encodable> = remoteDB;
|
|
37
|
-
|
|
38
|
-
private static record: Array<any> = new Array<any>();
|
|
39
|
-
|
|
40
|
-
static init(): void {
|
|
41
|
-
console.log("Recorder initializing");
|
|
42
|
-
Recorder.localDB.allDocs({
|
|
43
|
-
include_docs: true
|
|
44
|
-
}).then(
|
|
45
|
-
(docs: PouchDB.Core.AllDocsResponse<PouchDB.Core.Encodable>) => {
|
|
46
|
-
docs.rows.forEach((row) => {
|
|
47
|
-
// console.log("Adding " + row + " to in-memory records.");
|
|
48
|
-
Recorder.record.push(row.doc);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
).catch((err) => {
|
|
52
|
-
console.log(err);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static getRecord(): Array<any> {
|
|
57
|
-
return Recorder.record;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static addRecord(record: QuestionRecord) {
|
|
61
|
-
console.log("Adding a record...");
|
|
62
|
-
|
|
63
|
-
record._id = new Date().toJSON();
|
|
64
|
-
|
|
65
|
-
// add record to in-memory records
|
|
66
|
-
Recorder.record.push(record);
|
|
67
|
-
// add record to db - syncs with cloudant
|
|
68
|
-
Recorder.localDB.put(record);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
This file is the 'validate_doc_update' value of _users/_design/_auth
|
|
3
|
-
|
|
4
|
-
{
|
|
5
|
-
"_id": "_design/_auth",
|
|
6
|
-
"_rev": "1-c79bc00c889ce9b912fbde8a3f52de37",
|
|
7
|
-
"value": {
|
|
8
|
-
"rev": "1-c79bc00c889ce9b912fbde8a3f52de37"
|
|
9
|
-
},
|
|
10
|
-
"key": "_design/_auth",
|
|
11
|
-
"doc": {
|
|
12
|
-
"_id": "_design/_auth",
|
|
13
|
-
"_rev": "1-c79bc00c889ce9b912fbde8a3f52de37",
|
|
14
|
-
"language": "javascript",
|
|
15
|
-
"validate_doc_update": (this file)
|
|
16
|
-
}
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function validate_doc_update(newDoc, oldDoc, userCtx, secObj) {
|
|
20
|
-
if (newDoc._deleted === true) {
|
|
21
|
-
// allow deletes by admins and matching users
|
|
22
|
-
// without checking the other fields
|
|
23
|
-
if ((userCtx.roles.indexOf('_admin') !== -1) || (userCtx.name == oldDoc.name)) {
|
|
24
|
-
return;
|
|
25
|
-
} else {
|
|
26
|
-
throw ({ forbidden: 'Only admins may delete other user docs.' });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (newDoc.type !== 'user') {
|
|
30
|
-
throw ({ forbidden: 'doc.type must be user' });
|
|
31
|
-
} // we only allow user docs for now
|
|
32
|
-
|
|
33
|
-
if (!newDoc.name) {
|
|
34
|
-
throw ({ forbidden: 'doc.name is required' });
|
|
35
|
-
}
|
|
36
|
-
if (!newDoc.roles) {
|
|
37
|
-
throw ({ forbidden: 'doc.roles must exist' });
|
|
38
|
-
}
|
|
39
|
-
if (!isArray(newDoc.roles)) {
|
|
40
|
-
throw ({ forbidden: 'doc.roles must be an array' });
|
|
41
|
-
}
|
|
42
|
-
for (var idx = 0; idx < newDoc.roles.length; idx++) {
|
|
43
|
-
if (typeof newDoc.roles[idx] !== 'string') {
|
|
44
|
-
throw ({ forbidden: 'doc.roles can only contain strings' });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (newDoc._id !== ('org.couchdb.user:' + newDoc.name)) {
|
|
48
|
-
throw ({ forbidden: 'Doc ID must be of the form org.couchdb.user:name' });
|
|
49
|
-
}
|
|
50
|
-
if (oldDoc) { // validate all updates
|
|
51
|
-
if (oldDoc.name !== newDoc.name) {
|
|
52
|
-
throw ({ forbidden: 'Usernames can not be changed.' });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (newDoc.password_sha && !newDoc.salt) {
|
|
56
|
-
throw ({ forbidden: 'Users with password_sha must have a salt.' + 'See /_utils/script/couch.js for example code.' });
|
|
57
|
-
}
|
|
58
|
-
if (newDoc.password_scheme === "pbkdf2") {
|
|
59
|
-
if (typeof (newDoc.iterations) !== "number") {
|
|
60
|
-
throw ({ forbidden: "iterations must be a number." });
|
|
61
|
-
}
|
|
62
|
-
if (typeof (newDoc.derived_key) !== "string") {
|
|
63
|
-
throw ({ forbidden: "derived_key must be a string." });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (!is_server_or_database_admin(userCtx, secObj)) {
|
|
69
|
-
if (oldDoc) { // validate non-admin updates
|
|
70
|
-
if (userCtx.name !== newDoc.name) {
|
|
71
|
-
throw ({ forbidden: 'You may only update your own user document.' });
|
|
72
|
-
}
|
|
73
|
-
// validate role updates
|
|
74
|
-
var oldRoles = (oldDoc.roles || []).sort();
|
|
75
|
-
var newRoles = newDoc.roles.sort();
|
|
76
|
-
if (oldRoles.length !== newRoles.length) {
|
|
77
|
-
throw ({ forbidden: 'Only _admin may edit roles' });
|
|
78
|
-
}
|
|
79
|
-
for (var i = 0; i < oldRoles.length; i++) {
|
|
80
|
-
if (oldRoles[i] !== newRoles[i]) {
|
|
81
|
-
throw ({ forbidden: 'Only _admin may edit roles' });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
} else if (newDoc.roles.length > 0) {
|
|
85
|
-
throw ({ forbidden: 'Only _admin may set roles' });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// no system roles in users db
|
|
90
|
-
for (var i = 0; i < newDoc.roles.length; i++) {
|
|
91
|
-
if (newDoc.roles[i][0] === '_') {
|
|
92
|
-
throw ({ forbidden: 'No system roles (starting with underscore) in users db.' });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// no system names as names
|
|
97
|
-
if (newDoc.name[0] === '_') {
|
|
98
|
-
throw ({ forbidden: 'Username may not start with underscore.' });
|
|
99
|
-
}
|
|
100
|
-
var badUserNameChars = [':'];
|
|
101
|
-
for (var i = 0; i < badUserNameChars.length; i++) {
|
|
102
|
-
if (newDoc.name.indexOf(badUserNameChars[i]) >= 0) {
|
|
103
|
-
throw ({ forbidden: 'Character `' + badUserNameChars[i] + '` is not allowed in usernames.' });
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
var is_server_or_database_admin = function (userCtx, secObj) {
|
|
110
|
-
// see if the user is a server admin
|
|
111
|
-
if (userCtx.roles.indexOf('_admin') !== -1) {
|
|
112
|
-
return true; // a server admin
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// see if the user a database admin specified by name
|
|
116
|
-
if (secObj && secObj.admins && secObj.admins.names) {
|
|
117
|
-
if (secObj.admins.names.indexOf(userCtx.name) !== -1) {
|
|
118
|
-
return true; // database admin
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// see if the user a database admin specified by role
|
|
123
|
-
if (secObj && secObj.admins && secObj.admins.roles) {
|
|
124
|
-
var db_roles = secObj.admins.roles;
|
|
125
|
-
for (var idx = 0; idx < userCtx.roles.length; idx++) {
|
|
126
|
-
var user_role = userCtx.roles[idx];
|
|
127
|
-
if (db_roles.indexOf(user_role) !== -1) {
|
|
128
|
-
return true; // role matches!
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// default to no admin
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import * as RX from 'reactxp';
|
|
2
|
-
import Grader from '../appUtilities/Grader'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const styles = {
|
|
6
|
-
row: RX.Styles.createViewStyle({
|
|
7
|
-
flexDirection: 'row'
|
|
8
|
-
}),
|
|
9
|
-
entry: RX.Styles.createTextStyle({
|
|
10
|
-
width: 20,
|
|
11
|
-
height: 20,
|
|
12
|
-
margin: 10,
|
|
13
|
-
borderColor: 'black',
|
|
14
|
-
borderStyle: "solid",
|
|
15
|
-
borderWidth: 1,
|
|
16
|
-
borderRadius: 3,
|
|
17
|
-
textAlign: 'center',
|
|
18
|
-
textAlignVertical: 'center'
|
|
19
|
-
})
|
|
20
|
-
}
|
|
21
|
-
const rows = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
22
|
-
|
|
23
|
-
interface ComponentChartProps {
|
|
24
|
-
questionType: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
class ProgressChart extends RX.Component<ComponentChartProps, null> {
|
|
28
|
-
|
|
29
|
-
render() {
|
|
30
|
-
return (
|
|
31
|
-
<RX.View>
|
|
32
|
-
<RX.Text>Progress Report for {this.props.questionType}</RX.Text>
|
|
33
|
-
{/*<table>
|
|
34
|
-
{this.renderTableBody()}
|
|
35
|
-
</table>*/}
|
|
36
|
-
<RX.View>
|
|
37
|
-
{this.renderBody()}
|
|
38
|
-
</RX.View>
|
|
39
|
-
</RX.View>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
getSign() {
|
|
43
|
-
if (this.props.questionType === 'multiplication') {
|
|
44
|
-
return (<RX.Text> × </RX.Text>);
|
|
45
|
-
} else {
|
|
46
|
-
return (<RX.Text> ÷ </RX.Text>);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
renderBody(): JSX.Element {
|
|
50
|
-
return (
|
|
51
|
-
<RX.View>
|
|
52
|
-
<RX.View style={styles.row}>
|
|
53
|
-
<RX.Text style={styles.entry}>{this.getSign()}</RX.Text>
|
|
54
|
-
<RX.Text style={styles.entry}>1</RX.Text>
|
|
55
|
-
<RX.Text style={styles.entry}>2</RX.Text>
|
|
56
|
-
<RX.Text style={styles.entry}>3</RX.Text>
|
|
57
|
-
<RX.Text style={styles.entry}>4</RX.Text>
|
|
58
|
-
<RX.Text style={styles.entry}>5</RX.Text>
|
|
59
|
-
<RX.Text style={styles.entry}>6</RX.Text>
|
|
60
|
-
<RX.Text style={styles.entry}>7</RX.Text>
|
|
61
|
-
<RX.Text style={styles.entry}>8</RX.Text>
|
|
62
|
-
<RX.Text style={styles.entry}>9</RX.Text>
|
|
63
|
-
<RX.Text style={styles.entry}>10</RX.Text>
|
|
64
|
-
</RX.View>
|
|
65
|
-
{rows.map((row, index) => {
|
|
66
|
-
return this.renderViewRow(row, index);
|
|
67
|
-
})}
|
|
68
|
-
</RX.View>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
renderViewRow(b: number, index: number): JSX.Element {
|
|
72
|
-
return (
|
|
73
|
-
<RX.View key={index.toString()} style={styles.row}>
|
|
74
|
-
<RX.Text style={styles.entry}>{b}</RX.Text>
|
|
75
|
-
{rows.map((row, rowIndex) => {
|
|
76
|
-
return this.renderViewGrade(row, b, rowIndex);
|
|
77
|
-
})}
|
|
78
|
-
</RX.View>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
renderViewGrade(a: number, b: number, index: number): JSX.Element {
|
|
83
|
-
const grade = Grader.Grade(this.props.questionType, a, b);
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<RX.Text key={index.toString()} style={this.getStyle(grade)}></RX.Text>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
getStyle(grade: Grade) {
|
|
90
|
-
|
|
91
|
-
return RX.Styles.createTextStyle({
|
|
92
|
-
backgroundColor: grade.getRGB(),
|
|
93
|
-
width: 20,
|
|
94
|
-
height: 20,
|
|
95
|
-
margin: 10,
|
|
96
|
-
borderColor: 'black',
|
|
97
|
-
borderStyle: "solid",
|
|
98
|
-
borderWidth: 1,
|
|
99
|
-
borderRadius: Math.floor(grade.averageTime)
|
|
100
|
-
}, false);
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
renderTableBody(): JSX.Element {
|
|
105
|
-
return (
|
|
106
|
-
<tbody>
|
|
107
|
-
<tr>
|
|
108
|
-
<td></td>
|
|
109
|
-
<td>1</td>
|
|
110
|
-
<td>2</td>
|
|
111
|
-
<td>3</td>
|
|
112
|
-
<td>4</td>
|
|
113
|
-
<td>5</td>
|
|
114
|
-
<td>6</td>
|
|
115
|
-
<td>7</td>
|
|
116
|
-
<td>8</td>
|
|
117
|
-
<td>9</td>
|
|
118
|
-
<td>10</td>
|
|
119
|
-
</tr>
|
|
120
|
-
{rows.map((row, index) => {
|
|
121
|
-
return this.renderRow(row, index);
|
|
122
|
-
})}
|
|
123
|
-
</tbody>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
renderRow(b: number, index: number): JSX.Element {
|
|
127
|
-
console.log("Rendering row " + b);
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<tr key={index}>
|
|
131
|
-
<td>{b}</td>
|
|
132
|
-
{rows.map((row, rowIndex) => {
|
|
133
|
-
return this.renderGrade(row, b, rowIndex);
|
|
134
|
-
})}
|
|
135
|
-
</tr>
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
renderGrade(a: number, b: number, index: number): JSX.Element {
|
|
139
|
-
console.log("\tRendering grade " + a + ", " + b);
|
|
140
|
-
const grade = Grader.Grade(this.props.questionType, a, b);
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<td key={index} style={grade.color()}>
|
|
144
|
-
|
|
145
|
-
</td>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
export default ProgressChart;
|
|
155
|
-
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as RX from 'reactxp';
|
|
2
|
-
// import img1 from './img/1.PNG'; // image-webpack-loader ?
|
|
3
|
-
|
|
4
|
-
export interface FingerCounterProps extends RX.CommonProps {
|
|
5
|
-
counted: number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const styles = {
|
|
9
|
-
img: RX.Styles.createViewStyle({
|
|
10
|
-
height: 120,
|
|
11
|
-
width: 150
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class FingerCounter extends RX.Component<FingerCounterProps, null> {
|
|
17
|
-
|
|
18
|
-
constructor(props: FingerCounterProps) {
|
|
19
|
-
super(props);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
if (this.props.counted === 0) {
|
|
25
|
-
return (
|
|
26
|
-
<RX.View style={styles.img}></RX.View>
|
|
27
|
-
)
|
|
28
|
-
} else {
|
|
29
|
-
return (
|
|
30
|
-
<RX.View style={styles.img}>
|
|
31
|
-
<img className="finger" src={"img/fingerCounter/" + this.props.counted + ".PNG"} alt="" />
|
|
32
|
-
</RX.View>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default FingerCounter;
|