This repository has been archived by the owner on Apr 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#50 Add: Data for list of menu in grammar
- Loading branch information
1 parent
2f5f9cb
commit 86332a2
Showing
8 changed files
with
227 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React, { Component } from 'react'; | ||
import { | ||
ActivityIndicator, | ||
AsyncStorage, | ||
Button, | ||
StatusBar, | ||
StyleSheet, | ||
View, | ||
ToolbarAndroid, | ||
Text, | ||
TouchableOpacity, | ||
} from 'react-native'; | ||
|
||
import { withNavigation } from 'react-navigation'; | ||
import { strings } from '../../config/localization'; | ||
import { QuizListData } from '../../config/studyList'; | ||
|
||
class QuizBeforeScreen extends Component { | ||
|
||
static navigationOptions = ({ navigation }) => { | ||
subtitle = navigation.getParam('typeQuiz', null); | ||
title = navigation.getParam('title', null); | ||
|
||
return{ | ||
title: title, | ||
tabBarVisible:false, | ||
header: props => <Header | ||
title={ strings[title] } | ||
subtitle={ subtitle } | ||
navigation={ navigation } | ||
/> | ||
} | ||
}; | ||
|
||
constructor(props){ | ||
super(props); | ||
this.list = QuizListData.hiragana_katakana; | ||
this._onSetLanguageTo('en'); | ||
} | ||
|
||
_onSetLanguageTo(value) { | ||
strings.setLanguage(value); | ||
} | ||
|
||
render() { | ||
return ( | ||
<View style={styles.containerFlexColumn}> | ||
{this.list.map((item, key)=>( | ||
<View key={key} style={styles.quizList}> | ||
<TouchableOpacity onPress={this.quiz.bind(this, item.type)}> | ||
<Text style={styles.hiraganaListText}> {strings[item.title]} </Text> | ||
</TouchableOpacity> | ||
</View> | ||
))} | ||
</View> | ||
); | ||
} | ||
|
||
quiz = (type) => { | ||
const { navigation } = this.props; | ||
|
||
this.props.navigation.navigate('QuizList',( | ||
{ | ||
type: navigation.getParam('type',null), | ||
title: navigation.getParam('title',null), | ||
studyType: navigation.getParam('studyType',null), | ||
img: navigation.getParam('img',null), | ||
topicId: navigation.getParam('topicId',null), | ||
typeQuiz: navigation.getParam('typeQuiz',null), | ||
quizOptions: navigation.getParam('quizOptions',null), | ||
oneType: type, | ||
index: navigation.getParam('index',null), | ||
} | ||
)); | ||
}; | ||
} | ||
|
||
const styles = require('../../styles/quizStyle'); | ||
|
||
export default QuizBeforeScreen; |
Oops, something went wrong.