Navigation part 2

This commit is contained in:
MedihaZukic
2017-09-23 21:56:01 +02:00
parent 0b6e22373f
commit 5884e20ecf
5 changed files with 42 additions and 6 deletions

16
package-lock.json generated
View File

@@ -6242,6 +6242,14 @@
"prop-types": "15.5.10"
}
},
"react-native-deck-swiper": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/react-native-deck-swiper/-/react-native-deck-swiper-1.3.8.tgz",
"integrity": "sha1-U2LjDSksuFrrn/fJ3xvNst+vZGs=",
"requires": {
"prop-types": "15.5.10"
}
},
"react-native-dismiss-keyboard": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/react-native-dismiss-keyboard/-/react-native-dismiss-keyboard-1.0.0.tgz",
@@ -6263,6 +6271,14 @@
"react-native-drawer-layout": "1.3.2"
}
},
"react-native-progress": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/react-native-progress/-/react-native-progress-3.4.0.tgz",
"integrity": "sha512-Kqc+wwQHyBG83Fnbb84oM9qqgn1d51ABVS/RK36V+35KmihEYx33WijdQT05iwT+tfJWGArvFLsZWbd8mKyJ6A==",
"requires": {
"prop-types": "15.5.10"
}
},
"react-native-router-flux": {
"version": "4.0.0-beta.21",
"resolved": "https://registry.npmjs.org/react-native-router-flux/-/react-native-router-flux-4.0.0-beta.21.tgz",

View File

@@ -11,7 +11,7 @@
"react-native": "0.47.0",
"react-native-deck-swiper": "^1.3.8",
"react-native-progress": "^3.4.0",
"react-native-router-flux": "^4.0.0-beta.21"
"react-native-router-flux": "^4.0.0-beta.21"
},
"devDependencies": {
"babel-jest": "21.0.2",

View File

@@ -3,6 +3,7 @@ import { Scene, Router, Stack } from 'react-native-router-flux';
import Categories from './components/Categories';
import LessonCategories from './components/LessonCategories';
import AnatomyCard from './components/AnatomyCard';
import Lesson from './components/Lesson';
const RouterComponent = () => {
const { headerTextStyle } = styles;
@@ -30,6 +31,13 @@ const RouterComponent = () => {
headerStyle={headerStyle('#808285')}
headerTitleStyle={headerTextStyle}
/>
<Scene
key="lesson"
component={Lesson}
title="IMA LI MLIJEKA?"
headerStyle={headerStyle('#7270a8')}
headerTitleStyle={headerTextStyle}
/>
</Stack>
</Router>
);

View File

@@ -12,10 +12,6 @@ const Lesson = (props) => {
return (
<View style={categoriesContainerStyle}>
<ApplicationHeader
headerText={props.lessonHeaderText}
headerBackgroudColor={props.lessonHeaderBackroundColor}
/>
<View style={categoriesListStyle}>
{renderQuestions()}
</View>

View File

@@ -1,12 +1,28 @@
import React from 'react';
import { View } from 'react-native';
import { Actions } from 'react-native-router-flux';
import CategoryItem from './CategoryItem';
const LessonCategories = () => {
const { categoriesContainerStyle, categoriesListStyle } = styles;
const onLessonSelected = (selectedLesson) => {
console.log(selectedLesson);
switch(selectedLesson){
case 'IMA LI MLIJEKA?':
Actions.lesson({
lessonHeaderText: 'IMA LI MLIJEKA?',
questions:
['Kako funkcioniše produkcija mlijeka?',
'Uspostavljanje i zadržavanje zaliha mlijeka kad beba ne doji',
'Prejak refleks otpuštanja mlijeka ili prekomjerne zalihe',
'Koje biljke izbjegavati za vrijeme dojenja'
],
lessonHeaderBackroundColor: '#7270a8'
});
break;
default:
console.log(selectedLesson);
}
};
return (