Skip to content

Osula/Question-Answer-React-Native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Question-Answer-React-Native

A dynamic Questions and Answers section for your react-native app.

Buil with

React Native

Import AnswerInput from answerInput.js and QuestionAnswered from questionAnswered.js from the files

import AnswerInput from './answerInput';
import QuestionAnswered from './questionAnswered';

Prerequisites

Libraries you need to install

import React from 'react';
import { StyleSheet, video,ListView, ScrollView,FlatList, Platform, fontWeight, Image, backgroundColor, Text, fontFamily, fontSize, View, Button, TouchableHighlight, TextInput, TouchableOpacity, Alert,} from 'react-native';
import {RkButton} from 'react-native-ui-kitten';
import Swipeout from 'react-native-swipeout';
import ViewMoreText from 'react-native-read-more-text';

Usage

Under every question, there is an input when pressin Answer. After answering, the answer and the question go to the other page, under 'Answered'.

Examples:

addNewAnswer(newAnswer){
        console.log('calling addNewAnswer in questions')
        var newAnswerList = this.state.answers;
        console.log('pushing new answer:' + JSON.stringify(newAnswer))
        newAnswerList.push(newAnswer)
        console.log('updating status with new answers list')
        this.setState({answers: newAnswerList})
        this.setState({status: false})
        console.log('hiding card')
        this.setState({cardVisible: false})
    }


    renderToAnswer(){
        return this.state.questions.map(this.returnAnswerInputForQuestion.bind(this))
    }

About

A Q&A section

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published