Components

LessonSingleScreen

<LessonSingleScreen />

Constructor

# <LessonSingleScreen />

You can use this component to display your Lesson single screen in your custom screen.

Properties:
Name Type Attributes Description
lessonId Number <optional>

The id of the lesson to display

courseId Number <optional>

The id of the course where the lesson belongs

hidePrevNext Boolean <optional>

Use true to hide Prev and Next buttons

hideBackToCourse Boolean <optional>

Use true to hide back button

Example

Use LessonSingleScreen without back and PrevNext buttons

//In custom_code/components/MyCustomScreen.js

import React from 'react';
import {View, Text} from 'react-native';
import LessonSingleScreen from "@src/containers/Custom/LessonSingleScreen";

const MyCustomScreen = (props) => {

  const courseId = 162; //Pass course id of the lesson
  const lessonId = 164; //Pass id of lesson to load

  if (!props.isFocused)
     return null;

   return (

     <View style={{flex: 1}}>

        <View style={{flex: 0.1, alignItems: 'center', justifyContent: 'center'}}>
           <Text> Here is the Lesson for the Day! </Text>
        </View>

        <View style={{flex: 0.9, marginBottom: 80}}>
           <LessonSingleScreen courseId={courseId} lessonId={lessonId} hidePrevNext={true} hideBackToCourse={true} {...props} />
        </View>

     </View>
  )


}

export default MyCustomScreen;

//In custom_code/index.js...

...

import MyCustomScreen from "./components/MyCustomScreen";

export const applyCustomCode = externalCodeSetup => {

 externalCodeSetup.navigationApi.addNavigationRoute(
   "book",
   "BookScreen",
   MyCustomScreen,
   "All"
 );
 externalCodeSetup.navigationApi.addNavigationRoute(
   "book",
   "BookScreen",
   MyCustomScreen,
   "Main"
 );
}