Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #77 from ZendyLim/feature/summaryDetail
Browse files Browse the repository at this point in the history
Feature/summary detail
  • Loading branch information
viinkelvin authored Jun 11, 2018
2 parents cc5170d + 303a9c7 commit a921a28
Show file tree
Hide file tree
Showing 26 changed files with 302 additions and 126 deletions.
18 changes: 16 additions & 2 deletions app/actions/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {FETCH_USER , FETCH_USER_SUCCESS , FETCH_USER_FAILED, USER_REMOVE} from '../lib/constants';
import {FETCH_USER , FETCH_USER_SUCCESS , FETCH_USER_FAILED, USER_REMOVE , LOCALIZATION} from '../lib/constants';
import { USER_LOGIN_SUCCESS, USER_LOGIN_FAILED, USER_UPDATE_SUCCESS} from '../lib/constants';
import { AsyncStorage } from 'react-native';

Expand Down Expand Up @@ -87,6 +87,13 @@ export function deleteUserState(){
};
}

export function localization(Value){
return (dispatch) => {
dispatch(localizationDispatch(Value))
};
}


export function updateProfile(userVal){
return (dispatch) => {
console.log('run');
Expand Down Expand Up @@ -202,4 +209,11 @@ export function userLoginFailed(error){
type: USER_LOGIN_FAILED,
error: error,
}
}
}

export function localizationDispatch(value){
return{
type: LOCALIZATION,
data: value,
}
}
10 changes: 1 addition & 9 deletions app/component/correct.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,9 @@ class CorrectPanel extends Component {

constructor(props) {
super(props);

this._onSetLanguageTo('en');
this.currentAudio = this.props.question.id;

this.currentAudio = this.props.question.id;
this.imageSource = this.props.img ? ( ImageData[this.props.img] ) : ImageData.default_bg;
}

_onSetLanguageTo(value) {
strings.setLanguage(value);
}

componentWillMount() {

this.loadAudio();
Expand Down
6 changes: 0 additions & 6 deletions app/component/question.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,11 @@ class QuestionPanel extends Component {

constructor(props) {
super(props);

this._onSetLanguageTo('en');
this.currentAudio = this.props.question.id;
this.currentQuestion = '';
this.imageSource = this.props.img ? ( ImageData[this.props.img] ) : ImageData.default_bg;
}

_onSetLanguageTo(value) {
strings.setLanguage(value);
}

componentWillMount() {
this.currentQuestion = this.props.question.id;
if(this.props.format == 'audio'){
Expand Down
76 changes: 53 additions & 23 deletions app/config/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,22 @@ export let strings = new LocalizedStrings({
FUKUSHU2_TITLE : "FUKUSHU TEST",
FUKUSHU3_TITLE : "FUKUSHU TEST",
FUKUSHU4_TITLE : "FUKUSHU TEST",
},
SETTING_LANGUAGES : "APLICCATION LANGUAGES",
SETTING_LANGUAGES_PROFILE : "LANGUAGES SETTINGS",
HOME_STUDY : "STUDY",
HOME_SUMMARY : "SUMMARY",
HOME_PROFILE : "PROFILE",
HOME_TARGET : "Target Date",
HOME_LEFT : "d Left",
HOME_MESSAGE : "Hello! How are you\nLet's Study",
STUDY_LEARN : "LEARN",
STUDY_QUIZ : "QUIZ",
STUDY_TEST : "TEST",
STUDY_START : "START",
STUDY_REVIEW : "REVIEW",
PROFILE_MODAL_CLOSE : "CANCEL",

},
ja: {
loginGuest: "japan",
vocabulary : "語彙",
Expand Down Expand Up @@ -103,15 +118,15 @@ export let strings = new LocalizedStrings({
QUESTION_ARRANGE : "Arrange the sentence",
// Quiz
TIMES_UP: "時間です",
WORD_LIST: "WORD LIST",
EXPLANATION: "EXPLANATION",
FLASH_CARD: "FLASH CARD",
DRAW: "DRAW",
GOI_LIST : "VOCABULARY LIST",
BUNPO_LIST : "GRAMMAR LIST",
KANJI_LIST : "KANJI LIST",
FLASH_CARD_HIRAGANA: "FLASH CARD HIRAGANA",
FLASH_CARD_KATAKANA: "FLASH CARD KATAKANA",
WORD_LIST: "言葉一覧",
EXPLANATION: "説明",
FLASH_CARD: "フラッシュカード",
DRAW: "ドロー",
GOI_LIST : "語彙一覧",
BUNPO_LIST : "文法一覧",
KANJI_LIST : "漢字一覧",
FLASH_CARD_HIRAGANA: "フラッシュカードひらがな",
FLASH_CARD_KATAKANA: "フラッシュカードカタカナ",
HIKA_ROMA: "Hiragana/Katakana to Romaji",
ROMA_HIKA: "Romaji to Hiragana/Katakana",
LISTEN: "Listening",
Expand All @@ -121,19 +136,34 @@ export let strings = new LocalizedStrings({
REARRANGE: "Rearrange the sentence",
ENGLISH: "英語",
NEXT:'次',
WORD_LIST_LEARN: "WORD LIST",
EXPLANATION_LEARN: "EXPLANATION",
FLASH_CARD_LEARN: "FLASH CARD",
DRAW_LEARN: "DRAW",
GOI_LIST_LEARN : "VOCABULARY LIST",
BUNPO_LIST_LEARN : "GRAMMAR LIST",
KANJI_LIST_LEARN : "KANJI LIST",
FLASH_CARD_HIRAGANA_LEARN: "FLASH CARD HIRAGANA",
FLASH_CARD_KATAKANA_LEARN: "FLASH CARD KATAKANA",
FUKUSHU1_TITLE : "FUKUSHU TEST",
FUKUSHU2_TITLE : "FUKUSHU TEST",
FUKUSHU3_TITLE : "FUKUSHU TEST",
FUKUSHU4_TITLE : "FUKUSHU TEST",
WORD_LIST_LEARN: "言葉一覧",
EXPLANATION_LEARN: "説明",
FLASH_CARD_LEARN: "フラッシュカード",
DRAW_LEARN: "ドロー",
GOI_LIST_LEARN : "語彙一覧",
BUNPO_LIST_LEARN : "文法一覧",
KANJI_LIST_LEARN : "漢字一覧",
FLASH_CARD_HIRAGANA_LEARN: "フラッシュカードひらがな",
FLASH_CARD_KATAKANA_LEARN: "フラッシュカードカタカナ",
FUKUSHU1_TITLE : "復習テスト",
FUKUSHU2_TITLE : "復習テスト",
FUKUSHU3_TITLE : "復習テスト",
FUKUSHU4_TITLE : "復習テスト",
SETTING_LANGUAGES : "アプリの語",
SETTING_LANGUAGES_PROFILE : "語の設定",
HOME_STUDY : "勉強",
HOME_SUMMARY : "概要",
HOME_PROFILE : "プロフィール",
HOME_TARGET : "制限時間",
HOME_LEFT : "日残り",
HOME_MESSAGE : "こんにちは!お元気ですか?\n勉強しましょう!",
STUDY_LEARN : "学ぶ",
STUDY_QUIZ : "クイズ",
STUDY_TEST : "テスト",
STUDY_START : "スタート",
STUDY_REVIEW : "レビュー",
PROFILE_MODAL_CLOSE : "キャンセル",


}
});
4 changes: 3 additions & 1 deletion app/config/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import KatakanaLearnScreen from '../screens/Learn/katakanalearn';
import SummaryTopicList from '../screens/Summary/studyPick';
import SummaryLearnDetail from '../screens/Summary/summaryLearn';
import reviewScreen from '../screens/Summary/reviewSummary';
import mainSettings from '../screens/Setting/mainsetting';


const styles = require('../styles/style');
Expand Down Expand Up @@ -95,7 +96,8 @@ const SettingStack = StackNavigator({
});

const ProfileStack = StackNavigator({
ProfileMain: ProfileScreen
ProfileMain: ProfileScreen,
MainSettingScreen : mainSettings
});
// const QuizHiraganaListStack = StackNavigator({
// QuizHiraganaList: QuizHiraganaListScreen
Expand Down
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Root = SwitchNavigator(
class App extends Component {
render() {
return (
//<HL4 />
// <HL4 />
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Root />
Expand Down
1 change: 1 addition & 0 deletions app/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const TAKE_QUIZ = 'TAKE_QUIZ'; //import the action for start time
export const USER_LOGIN_SUCCESS = "USER_LOGIN_SUCCESS";
export const USER_LOGIN_FAILED = " USER_LOGIN_FAILED";
export const USER_UPDATE_SUCCESS = "USER_UPDATE_SUCCESS";
export const LOCALIZATION = "LOCALIZATION";
//summary
export const SUMMARY_HOME = 'SUMMARY_HOME'; //import the action for start time
export const SUMMARY_TEST = 'SUMMARY_TEST'; //import the action for Summary Test
Expand Down
7 changes: 6 additions & 1 deletion app/reducers/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {DATA_AVAILABLE ,FETCH_USER , FETCH_USER_SUCCESS , FETCH_USER_FAILED , USER_REMOVE} from '../lib/constants';
import {DATA_AVAILABLE ,FETCH_USER , FETCH_USER_SUCCESS , FETCH_USER_FAILED , USER_REMOVE, LOCALIZATION} from '../lib/constants';

import{USER_LOGIN_SUCCESS, USER_LOGIN_FAILED, USER_UPDATE_SUCCESS} from '../lib/constants';

Expand Down Expand Up @@ -66,6 +66,11 @@ export default function userReducer (state = initialState, action) {
user: action.data,
});
return state;
case LOCALIZATION:
state = Object.assign({}, state, {
lang: action.data,
});
return state;
default:
return state;
}
Expand Down
4 changes: 0 additions & 4 deletions app/screens/Learn/HL2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import ImageData from '../../config/image_list';
class HL2Screen extends Component {
constructor() {
super();
this._onSetLanguageTo('en');
}
_onSetLanguageTo(value) {
strings.setLanguage(value);
}
static navigationOptions = {
title: 'Learn',
};
Expand Down
4 changes: 0 additions & 4 deletions app/screens/Learn/LearnList.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import style from 'react-native-datepicker/style';
class LearnListScreen extends Component {
constructor() {
super();
this._onSetLanguageTo('en');
}
_onSetLanguageTo(value) {
strings.setLanguage(value);
}
static navigationOptions = {
title: 'Learn',
};
Expand Down
4 changes: 0 additions & 4 deletions app/screens/Learn/LearnModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ import LearnGBK01Screen from '../Learn/LearnGBK01';
class LearnHiraganaModule extends Component {
constructor(props) {
super(props);
this._onSetLanguageTo('en');
}
_onSetLanguageTo(value) {
strings.setLanguage(value);
}
static navigationOptions = {
title: 'Learn',
swipeEnabled: false
Expand Down
4 changes: 0 additions & 4 deletions app/screens/Learn/SL2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import ImageData from '../../config/image_list';
class SL2Screen extends Component {
constructor() {
super();
this._onSetLanguageTo('en');
}
_onSetLanguageTo(value) {
strings.setLanguage(value);
}
static navigationOptions = {
title: 'Learn',
};
Expand Down
5 changes: 0 additions & 5 deletions app/screens/Login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ import {
class LoginScreen extends Component {
constructor() {
super();
this._onSetLanguageTo('en');
}
_onSetLanguageTo(value) {
strings.setLanguage(value);
//this.setState({});
}
static navigationOptions = {
header: null,
Expand Down
5 changes: 0 additions & 5 deletions app/screens/Login/login_new..js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import {
Username: '',
Password: '',
};
this._onSetLanguageTo('en');
}
_onSetLanguageTo(value) {
strings.setLanguage(value);
//this.setState({});
}
static navigationOptions = {
header: null,
Expand Down
Loading

0 comments on commit a921a28

Please sign in to comment.