Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from "react";
- import {
- ImageBackground,
- SafeAreaView,
- Text,
- View,
- Dimensions,
- ScrollView,
- Image,
- TouchableOpacity,
- StyleSheet,
- FlatList,
- Alert,
- Modal,
- // Customizable Area Start
- ActivityIndicator,
- TextInput
- // Customizable Area End
- } from "react-native";
- // Customizable Area Start
- import VideoPlayer from "react-native-video-player";
- import Loader from "../../../components/src/Loader";
- import moment from "moment";
- import { Formik } from "formik";
- import * as yup from "yup";
- import { articlesBlog, articlesArticle, audioIcon, pause } from "./assets";
- import ModalWrapper from "../../../components/src/ModalWrapper";
- import Typography from "../../../components/src/Typography";
- import Input from "../../../components/src/Input";
- import Button from "../../../components/src/Button";
- import CalendarStrip from "../../../components/src/CalendarStrip";
- import DateTimePicker from "../../../components/src/DateTimePicker";
- import { BASE_URL, Colors, dimensions } from "../../../components/src/utils";
- import GoalModal from "../../../components/src/GoalModal";
- import GoalCalendarStrip from "../../../components/src/GoalCalendarStrip";
- // Customizable Area End
- //@ts-ignore
- import Drawer from "react-native-drawer";
- import * as IMG_CONST from './assets'
- // Customizable Area End
- import Scale from "../../../framework/src/Scale";
- const { height, width } = Dimensions.get('window');
- import HomePageController, { Props } from "./HomePageController";
- import ModalPage from "./ModalPage";
- export default class HomePage extends HomePageController {
- constructor(props: Props) {
- super(props);
- }
- // Customizable Area Start
- actionSchema = yup.object().shape({
- title: yup.string().min(5, "Please enter 5 characters").required("This field is mandatory")
- });
- renderDashboardFocuseAreaItems = (itm: any) => {
- return (
- <>
- <View style={[styles.boxHeader, { backgroundColor: '#FFF5F4', borderColor: '#FFB8B0', }]} >
- <View style={{ alignSelf: 'center' }}>
- <View style={styles.exportText}>
- <Text style={[styles.TextHeader, { color: '#000', fontSize: 14, textAlign: 'center', marginLeft: 15 }]}>Top Focus Areas</Text>
- </View>
- <View style={{ alignSelf: 'center', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', marginEnd: 2, flex: 1 }}>
- {itm.assesment_test_type_answers.map((opt: any) => {
- return (
- <View style={styles.exportText2}>
- <Image source={require('../assets/view_circle.png')} style={styles.exportImage} />
- <Text style={[styles.TextPoints, { color: '#DF2A2A', flexWrap: 'wrap', flex: 1, marginRight: 10 }]} >{opt.answers}</Text>
- </View>
- )
- })}
- </View>
- </View>
- <TouchableOpacity style={{ justifyContent: 'flex-end', alignItems: 'center', flex: 1 }}>
- <Image style={{ alignSelf: 'center', justifyContent: 'center', alignItems: 'center' }} source={require('../assets/imagenav_down.png')} />
- </TouchableOpacity>
- </View>
- </>
- );
- };
- renderTopStrenght = (itm: any) => {
- return (
- <>
- <View style={styles.boxHeader} >
- <View style={{ alignSelf: 'center', }}>
- <View style={styles.exportText}>
- <Text style={[styles.TextHeader, { color: '#000', fontSize: 14, textAlign: 'center', marginLeft: 15 }]}>Top Strengths</Text>
- </View>
- <View style={{ alignSelf: 'center', flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start', marginEnd: 2, flex: 1 }}>
- {itm.assesment_test_type_answers.map((opt: any) => {
- return (
- <View style={styles.exportText2}>
- <Image source={require('../assets/view_circle2.png')} style={styles.exportImage} />
- <Text style={[styles.TextPoints, { flex: 1, flexWrap: 'wrap' }]}>{opt.answers}</Text>
- {/* <Text style={[styles.TextPoints,{flexWrap: 'wrap',flex:1,marginRight:10 }]} >{opt.answers}</Text> */}
- </View>
- )
- })}
- </View>
- </View>
- <TouchableOpacity style={{ justifyContent: 'flex-end', alignItems: 'center', flex: 1 }}>
- <Image style={{ alignSelf: 'center', justifyContent: 'center', alignItems: 'center' }} source={require('../assets/imagenav_up.png')} />
- </TouchableOpacity>
- </View>
- </>
- )
- }
- getList(item: any) {
- const { full_name, email, phone_number } = item.item.attributes.coach_details;
- return (
- <View style={styles.tableBox}>
- <View style={{ flexDirection: 'row', margin: 10, alignItems: 'flex-start', marginTop: 5 }}>
- <Image style={{ height: 70, width: 70, }} source={require('../assets/view_picture.png')} ></Image>
- <View style={{ marginLeft: 10 }}>
- <Text style={{ color: '#2F2F2F', fontSize: 15, fontStyle: 'normal', fontWeight: 'bold', margin: 5, marginTop: -1 }}> {full_name}</Text>
- <Text style={[styles.TextHeader, { color: '#6B5AED', margin: 5, marginTop: -2 }]}> {"Expert advisor"}</Text>
- <View style={{ flexDirection: 'row', marginTop: -20 }}>
- <Image style={{ height: 20, width: 20, resizeMode: 'contain' }} source={require('../assets/clock.png')} ></Image>
- <Text style={[{ color: '#6D6D6D', margin: 5, marginTop: 2, fontSize: 12, fontWeight: 'bold' }]}>{moment(item.item.attributes.start_time, 'DD/MM/YYYY HH').format("hh:mm A ")}</Text>
- <Text style={[{ color: '#6D6D6D', margin: 5, marginTop: 2, fontSize: 12, marginLeft: 0 }]}>{moment(item.item.attributes.start_time, 'DD/MM/YYYY HH').format("DD MMM YYYY")}</Text>
- <View style={{ height: Scale(35), marginTop: -10, width: Scale(95), marginLeft: 5, backgroundColor: '#FFFFFF', borderRadius: 10, borderWidth: 1, borderColor: '#3682FF', alignItems: 'center', justifyContent: 'center', alignSelf: 'center', }}>
- <TouchableOpacity>
- <Text style={{ color: '#3682FF', fontSize: 10, fontWeight: '500', alignSelf: 'center' }}>{"Connect now"}</Text>
- </TouchableOpacity>
- </View>
- </View>
- </View>
- <View style={{ flexDirection: 'row', marginLeft: Scale(-55), right: 10 }}>
- <Image style={{ right: 5, top: 2 }} source={require('../assets/imagenav_image6.png')} />
- <Text>{"4.5"}</Text>
- </View>
- </View>
- </View>
- );
- }
- renderActions = () => {
- if(this.state.loading){
- return null;
- }
- return this.state.actionData.map((item: any) => {
- const completed = moment(item?.attributes?.date).isSame(moment(), "day");
- return(
- <View style={[styles.actionRow, completed? styles.activeActionRow: styles.inActiveActionRow]}>
- <TouchableOpacity
- disabled={completed}
- onPress={() => this.completeAction(item.id, { date: moment().format("DD/MM/YYYY") })}
- style={[styles.actionCheckbox, completed? styles.activeActionCheckbox : styles.inactiveActionCheckbox]}
- />
- <View>
- <Typography font="MED" size={14} style={styles.actionText}>{item?.attributes?.action_item}</Typography>
- </View>
- </View>
- );
- });
- }
- renderArticles = () => {
- return this.state.articleData.map((item: any) => {
- return (
- <TouchableOpacity
- key={item.id}
- style={styles.article}
- >
- <Image
- source={articlesBlog}
- style={styles.articleImage}
- />
- <Typography>Article title</Typography>
- </TouchableOpacity>
- );
- });
- }
- renderAudio = () => {
- return this.state.audioData.map((item: any) => {
- return (
- <View
- key={item.id}
- style={styles.audioWrapper}
- >
- <View style={styles.audio}>
- <TouchableOpacity
- onPress={() => {
- if(this.state.nowPlaying === item.id){
- this.pauseAudio();
- }
- this.playAudio(`${BASE_URL}${item?.attributes?.file?.[0]}`, item.id)
- }}
- style={styles.audioPlay}
- >
- <Image source={(this.state.nowPlaying === item.id)? pause: audioIcon} style={styles.audioIcon} />
- </TouchableOpacity>
- </View>
- <Typography font="MED" align="center">Audio title</Typography>
- </View>
- );
- });
- }
- renderVideo = () => {
- return this.state.videoData.map((item: any) => {
- return (
- <View
- key={item.id}
- style={styles.videoBlock}
- >
- {/* <ImageBackground
- source={{ uri: "https://cdn.pixabay.com/photo/2016/10/26/19/00/domain-names-1772242_1280.jpg" }}
- style={styles.thumbnail}
- >
- <TouchableOpacity style={styles.videoPlay}>
- <Image source={audioIcon} style={styles.audioIcon} />
- </TouchableOpacity>
- </ImageBackground> */}
- <VideoPlayer
- video={{ uri: `${BASE_URL}${item?.attributes?.file?.[0]}` }}
- videoHeight={dimensions.wp(45)}
- videoWidth={dimensions.wp(70)}
- thumbnail={{ uri: "https://cdn.pixabay.com/photo/2016/10/26/19/00/domain-names-1772242_1280.jpg" }}
- />
- </View>
- );
- });
- }
- renderGaolBoardFocuseAreas(item: any) {
- return (
- <>
- {item.assesment_test_type_answers.map((ansOpt: any) => {
- return (<View style={styles.innerContainer}>
- <TouchableOpacity style={[styles.checkIpSytle, { backgroundColor: '#fff', alignItems: "center", }]} onPress={() => { this.setState({ checked: ansOpt.id }) }}>
- {this.state.checked == ansOpt.id ?
- <Image style={{ height: 25, width: 25, alignSelf: 'center', marginLeft: 20 }}{...this.btnShowImageProps} /> :
- <Image style={{ height: 25, width: 25, alignSelf: 'center', marginLeft: 20 }}
- {...this.btnHideImageProps} />}
- <Text style={[styles.title, { color: '#4D4D4D', textAlign: 'left', fontSize: 18, marginLeft: 10, flexWrap: 'wrap', flex: 1, marginRight: 10 }]}>{ansOpt.answers}</Text>
- </TouchableOpacity>
- </View>)
- })}
- </>
- )
- }
- renderGaolBoardData(item: any, id: any) {
- return (
- <View style={{ marginBottom: 10 }}>
- <TouchableOpacity style={{ marginTop: 10, alignItems: 'flex-start', backgroundColor: 'transparent', flex: 1 }}
- onPress={() => {
- this.markasCompetGoalModal(item.attributes.goal, item.id)
- }
- }
- >
- <View style={{ height: Scale(30), width: '70%', backgroundColor: '#FFFFFF', left: 10, flexDirection: 'row', alignItems: 'center', borderRadius: 10, right: 10, }}>
- <Image style={{ top: 2, left: 5 }} source={require('../assets/view_circle1.png')} />
- <Text style={{ flexWrap: 'wrap', textAlign: 'center', fontSize: 9, left: 10 }}>{item.attributes.goal}</Text>
- </View>
- </TouchableOpacity>
- </View>
- )
- }
- renderGoalCureentItm = () => {
- return (
- <View style={{ width: '75%', left: 10, top: 10 }}>
- <View style={styles.container}>
- <ImageBackground source={require('../assets/imagenav_image2.png')} style={{ height: Scale(180), width: '77%', borderRadius: 10, }} imageStyle={{ borderRadius: 16 }}>
- <View style={{ height: Scale(45), width: '75%', left: 10, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
- <Text style={{ fontWeight: '500', fontSize: 11, lineHeight: 16.5, }}>Current Goals</Text>
- <Image style={{ marginRight: 10 }} source={require('../assets/imagenav_image3.png')} />
- </View>
- <ScrollView nestedScrollEnabled={true} style={{ marginBottom: 20, }} >
- {this.state.goalData.map((goal) => {
- return (
- this.renderGaolBoardData(goal, goal.id)
- )
- })}
- </ScrollView>
- </ImageBackground>
- </View>
- </View>
- )
- }
- renderCompetedGoal = () => {
- // return this.state.completedGoalData.map((item: any) => {
- // console.log("render current goal",item);
- return (
- <View style={{ right: 102 }}>
- <ImageBackground source={require('../assets/imagenav_image.png')} style={{ height: Scale(180), width: '77%' }} imageStyle={{ borderRadius: 16 }}>
- <View style={{ height: Scale(45), width: '62%', left: 10, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
- <Text style={{ fontWeight: '500', fontSize: 11, lineHeight: 16.5, }}>Completed Goals</Text>
- <Image style={{}} source={require('../assets/imagenav_image4.png')} />
- </View>
- {this.state.completedGoalData.map((item: any) => {
- return (<View style={{ height: Scale(30), width: '70%', backgroundColor: '#FFFFFF', left: 10, flexDirection: 'row', alignItems: 'center', borderRadius: 10, right: 10,marginBottom: 10 }}>
- <Image style={{ top: 2, left: 5 }} source={require('../assets/view_circle3.png')} />
- <Text style={{ left: 10, color: '#3F3F3F', fontSize: 9, fontWeight: '500', flex: 1 }}>{item.attributes.goal}</Text>
- </View>)
- })}
- </ImageBackground>
- </View>
- );
- // });
- }
- renderDrawer() {
- return (
- <SafeAreaView style={styles.containerFilter}>
- <View style={styles.HomeContainer}>
- <View style={styles.headerImage}>
- <Image style={styles.ProfileImage} source={IMG_CONST.PROFILE_ICON} />
- <View style={styles.ProfileTextHeader}>
- <Text style={styles.profileFirstText}>Reaecca Caala</Text>
- <Text style={styles.profileText}>US engineer</Text>
- </View>
- </View>
- <View style={styles.line}></View>
- <TouchableOpacity style={styles.accoutHeader} onPress={() => this.props.navigation.navigate("UserProfileBasicBlock")}>
- <Image style={styles.account} source={IMG_CONST.ACCOUNT_ICON} />
- <Text style={styles.AccountText}>Account Settings</Text>
- </TouchableOpacity>
- <TouchableOpacity style={styles.accoutHeader} onPress={() => this.props.navigation.navigate("PrivacyPolicy")}>
- <Image style={styles.account} source={IMG_CONST.PRIVACY_ICON} />
- <Text style={styles.AccountText}>Privacy Policy</Text>
- </TouchableOpacity>
- <TouchableOpacity style={styles.accoutHeader} onPress={() => this.props.navigation.navigate("ContactUsScreen")}>
- <Image style={styles.account} source={IMG_CONST.CONTACT_US_ICON} />
- <Text style={styles.AccountText}>Contact Us</Text>
- </TouchableOpacity>
- <TouchableOpacity style={styles.accoutHeader} onPress={() => this.logOut()}>
- <Image style={styles.account} source={IMG_CONST.LOGOUT_ICON} />
- <Text style={styles.AccountText}>Logout</Text>
- </TouchableOpacity>
- </View>
- </SafeAreaView>
- );
- }
- // Customizable Area End
- // Customizable Area Start
- render() {
- const { navigation } = this.props;
- const _this = this;
- return (
- <Drawer ref={(ref: any) => { this.drawer = ref; }}
- type="overlay"
- tapToClose={true}
- openDrawerOffset={0.35}
- content={this.renderDrawer()}
- style={{ flex: 1 }}
- >
- <ScrollView nestedScrollEnabled={true}>
- <SafeAreaView style={{ flex: 1 }}>
- {this.state.loading == false && <ImageBackground
- // blurRadius={this.state.isVisible ? 4 : 0}
- source={require("../assets/view_bg.png")} style={{ width: '100%', height: '53%', }}>
- <View style={styles.Header}>
- <TouchableOpacity onPress={this.openDrawer.bind(this)}>
- <Image source={require('../assets/imagenav_menu.png')} />
- </TouchableOpacity>
- <View style={{ flexDirection: 'row', right: '10%' }}>
- <Text style={styles.Text1}>Welcome</Text>
- <Text style={styles.Text2}>Sam!</Text>
- </View>
- <TouchableOpacity >
- <Image source={require("../assets/view_profile_pic.png")} style={{}} />
- </TouchableOpacity>
- <Image source={require("../assets/imagenav_ring3.png")} style={{ position: 'absolute', left: '74%' }} />
- </View>
- <View style={{ flexDirection: 'row', height: height / 13, width: '92%', alignSelf: 'center', justifyContent: 'space-between' }}>
- <View style={styles.boxContainer}>
- <View style={styles.box1}>
- <TouchableOpacity style={styles.btn}
- // {...this.wellBeingAssessPessProps}
- >
- <Image source={require("../assets/edit.png")} style={styles.edit} />
- <Text style={styles.editText}> Well-being Assessment</Text>
- </TouchableOpacity>
- </View>
- </View>
- <View style={styles.box2}>
- <TouchableOpacity style={styles.btn} {...this.asessYourselfPressProps}>
- <Image source={require("../assets/task-square.png")} style={styles.taskSquare} />
- <Text style={styles.taskSquareText}> Assess Yourself</Text>
- </TouchableOpacity>
- </View>
- </View>
- <View style={{ flexDirection: 'row', height: height / 13, width: '90%', alignSelf: 'center', justifyContent: 'space-between' }}>
- <View style={styles.boxContainer}>
- <View style={styles.box1}>
- <TouchableOpacity style={styles.btn}
- onPress={() => this.props.navigation.navigate('Appointments')}
- >
- <Image source={require("../assets/edit.png")} style={styles.edit} />
- <Text style={styles.editText}>Book Appointment</Text>
- </TouchableOpacity>
- </View>
- </View>
- </View>
- <View style={{ alignSelf: 'center', height: height / 16, width: '92%', }}>
- <Text style={{ color: '#fff', fontSize: 16, fontWeight: '500', }}> Insights</Text>
- </View>
- <Image source={require("../assets/imagenav_ring3.png")} style={{ position: 'absolute', top: '40%', left: '33%' }} />
- <View style={styles.mainexportBox}>
- {this.state.topStrenghts.map((item) => (
- this.renderTopStrenght(item.data.attributes)
- ))}
- {this.state.focusAreaData.map((item) => (
- this.renderDashboardFocuseAreaItems(item.data.attributes)
- ))}
- </View>
- {/* Add Goal */}
- <View style={styles.actionItemContainer}>
- <View style={styles.row}>
- <View style={styles.rowItem}>
- <Text style={{ fontSize: 16, fontWeight: '500', lineHeight: 24, color: '#3F3F3F' }}>Goal Board</Text>
- <Text style={{ fontSize: 11, fontWeight: '400', lineHeight: 24, color: '#878787' }}>Tap to view the listed goals status</Text>
- {/* <Text style={styles.Text1}>These are the action items for you</Text> */}
- </View>
- <Button
- mode="outlined"
- onPress={this.toggleAddGoalModal}
- style={styles.actionButton}
- textColor="primary"
- >
- Add Goals +
- </Button>
- </View>
- </View>
- {this.state.isGoalModal && (
- <GoalModal
- visible={this.state.isGoalModal}
- onClose={this.toggleAddGoalModal}
- title={this.state.isAddGoal ? `Add your goal` : this.state.iscompeteGaol ? `When do you wish to complete it?` : `On which focus area do you want \n to add goals?`}
- font="center"
- fontsize={20}
- titlecolor="#484848"
- // marginleft={10}
- >
- {this.state.goalstepmodal == 0 && this.state.focusAreaData.map((item) => (
- this.renderGaolBoardFocuseAreas(item.data.attributes)
- ))}
- {this.state.isAddGoal && <>
- <View
- style={[styles.mobileInput, { marginBottom: 20 }]}
- >
- <TextInput
- testID={"txtInputFirstName"}
- style={styles.Input}
- placeholderTextColor="#7CBBFF"
- placeholder={""}
- value={this.state.goalnm}
- {...this.txtInputGoalNamePrpos} //Merge Engine::From BDS - {...this.testIDProps}
- />
- </View>
- </>}
- {this.state.iscompeteGaol && <View style={{ margin: Scale(10) }}>
- <GoalCalendarStrip onSelect={(m) => {
- if (m.isBefore(moment()) || moment(m).format("DD/MM/YYYY") === moment().format("DD/MM/YYYY")) {
- this.showAlert("Alert", "Please choose a future date.", "");
- } else {
- this.setState({ goalCompetionDate: m })
- }
- }} />
- </View>}
- {this.state.goalstepmodal < 2 && <Button {...this.btnNxtModal}
- >
- Next
- </Button>}
- {this.state.iscompeteGaol && <Button
- {...this.btnSubmitModal}
- >
- Submit
- </Button>}
- </GoalModal>
- )}
- <View style={{ backgroundColor: '#fff', height: Scale(200), flexDirection: 'row', width: '92%', alignItems: 'center', justifyContent: 'space-between', borderRadius: 10, borderColor: '#979797', alignSelf: 'center' }}>
- {this.renderGoalCureentItm()}
- {this.renderCompetedGoal()}
- {/* <View style={{ width: '72%', right: 62 }}>
- {this.renderCompetedGoal()}
- </View> */}
- </View>
- {this.state.competeGoalModal && (
- <GoalModal
- visible={this.state.competeGoalModal}
- onClose={() => this.setState({
- competeGoalModal: true
- })}
- title={`Edit your goal`}
- font="center"
- fontsize={20}
- titlecolor="#484848"
- // marginleft={10}
- >
- <View
- style={[styles.mobileInput, { marginBottom: 20 }]}
- >
- <TextInput
- testID={"txtInputFirstName"}
- style={styles.Input}
- placeholderTextColor="#7CBBFF"
- placeholder={""}
- value={this.state.editgoal}
- {...this.txtInputEditGoalNamePrpos} //Merge Engine::From BDS - {...this.testIDProps}
- />
- </View>
- <Button {...this.btnSaveCompeteGoalModal}
- >
- Save
- </Button>
- <Button {...this.btnDeleteGoal}
- mode="outlined"
- textColor="bluemagenta"
- >
- Delete
- </Button>
- <Button
- {...this.btnMarkasCompeteGoal}
- >
- Mark as Complete
- </Button>
- </GoalModal>
- )}
- <View style={{ height: Scale(80), width: '92%', alignSelf: 'center' }}>
- <Text style={{ justifyContent: 'center', color: '#454545', fontSize: 18, fontWeight: '400', alignSelf: 'center', marginTop: Scale(25) }}>How are you feeling today?</Text>
- </View>
- <View style={{ height: Scale(290), width: '92%', alignSelf: 'center' }}>
- <View style={{ height: Scale(180), width: Scale(180), backgroundColor: '#fff', borderRadius: 180, alignSelf: 'center', justifyContent: "center", borderWidth: 4, borderColor: "#F1AB99" }}>
- <Image style={{ alignSelf: 'center', justifyContent: 'center' }} source={require('../assets/imagenav_niya.png')} />
- </View>
- <View>
- <Text style={{ justifyContent: 'center', alignSelf: 'center', fontSize: 16, fontWeight: '500', color: '#171717', top: 6 }}>Bad</Text>
- <Image style={{ tintColor: '#979797', alignSelf: 'center', justifyContent: 'center', bottom: 250 }} source={require('../assets/imagenav_slider.png')} />
- </View>
- </View>
- <View style={{ height: Scale(60), width: '92%', alignSelf: 'center' }}>
- <Text style={{ justifyContent: 'center', color: '#3F3F3F', fontSize: 16, fontWeight: '500', }}>Upcoming Appointments</Text>
- <Text style={{ justifyContent: 'center', color: '#878787', fontSize: 11, fontWeight: '400', marginTop: Scale(5) }}>Tap to view the appointment details</Text>
- </View>
- </ImageBackground>}
- {this.state.loading && <Loader loading={this.state.loading} />}
- </SafeAreaView>
- {this.state.appointmentData?.length > 0 &&
- <FlatList
- data={this.state.appointmentData}
- renderItem={(item) => this.getList(item)}
- extraData={this.state.appointmentData}
- keyExtractor={(item: any) => item.id}
- />
- }
- {/* Action Items - Start */}
- {(!this.state.loading) && (<View style={styles.actionItemContainer}>
- <View style={styles.row}>
- <View style={styles.rowItem}>
- {/* <Text style={styles.titleText}>These are the action items for you</Text> */}
- <Typography color="text" size={16} font="MED">These are the action items for you</Typography>
- </View>
- <Button
- onPress={this.toggleActionModal}
- textColor="primary"
- mode="outlined"
- textStyle={styles.actionButtonText}
- style={styles.actionButton}
- >
- Add Action Item +
- </Button>
- </View>
- </View>)}
- {this.renderActions()}
- {this.state.showActionModal && (
- <ModalWrapper
- visible={this.state.showActionModal}
- onClose={this.toggleActionModal}
- title={this.state.selectActionDuration ? "When do you wish to complete?" : "Add action item"}
- >
- <Formik
- initialValues={{
- title: "",
- time: moment("10:00", "hh:mm"),
- date: moment()
- }}
- onSubmit={(data) => {
- if (data.date.isBefore(moment())) {
- Alert.alert("", "Please select a future date");
- return;
- }
- this.createAction({
- date: data.date.format("DD/MM/YYYY"),
- action_item: data.title,
- time_slot: data.time.format("hh:mm a")
- });
- }}
- validationSchema={this.actionSchema}
- >
- {({ values, errors, touched, handleChange, handleBlur, setFieldValue, handleSubmit, validateForm }) => (
- <>
- {!this.state.selectActionDuration ? (
- <>
- <Input
- value={values.title}
- onChange={handleChange("title")}
- onBlur={handleBlur("title")}
- errorText={errors.title}
- touched={touched.title}
- mb={4}
- />
- <Button
- onPress={this.selectDuration}
- mode="outlined"
- textColor="accent"
- disabled={values.title.length < 5}
- >
- Next
- </Button>
- </>
- ) : (
- <>
- <CalendarStrip
- initDate={values.date}
- onSelect={(m) => {
- if (m.isBefore(moment())) {
- Alert.alert("", "Please select a future date");
- }
- setFieldValue("date", m);
- }}
- />
- <DateTimePicker value={values.time} mode="time" onSelect={(t) => setFieldValue("time", t)} />
- <Button onPress={handleSubmit} loading={this.state.actionLoader}>
- Submit
- </Button>
- </>
- )}
- </>
- )}
- </Formik>
- </ModalWrapper>
- )}
- {/* Action Items - End */}
- {/* Suggesrions - Start */}
- <View style={styles.block}>
- <View style={styles.row}>
- <Typography color="text" size={16} font="MED" mb={2}>Articles</Typography>
- <TouchableOpacity onPress={() => this.props.navigation.navigate("AudioLibrary", { type: "articles" })}>
- <Typography style={styles.moreLink} color="text" size={14} font="MED" mb={2}>View more</Typography>
- </TouchableOpacity>
- </View>
- </View>
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- style={styles.horizontalScroll}
- >
- {this.renderArticles()}
- </ScrollView>
- <View style={styles.block}>
- <View style={styles.row}>
- <Typography color="text" size={16} font="MED" mb={2}>Audios</Typography>
- <TouchableOpacity onPress={() => this.props.navigation.navigate("AudioLibrary", { type: "audio" })}>
- <Typography style={styles.moreLink} color="text" size={14} font="MED" mb={2}>View more</Typography>
- </TouchableOpacity>
- </View>
- </View>
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- style={styles.horizontalScroll}
- >
- {this.renderAudio()}
- </ScrollView>
- <View style={styles.block}>
- <View style={styles.row}>
- <Typography color="text" size={16} font="MED" mb={2}>Care Videos</Typography>
- <TouchableOpacity onPress={() => this.props.navigation.navigate("AudioLibrary", { type: "video" })}>
- <Typography style={styles.moreLink} color="text" size={14} font="MED" mb={2}>View more</Typography>
- </TouchableOpacity>
- </View>
- </View>
- <ScrollView
- horizontal
- showsHorizontalScrollIndicator={false}
- style={styles.horizontalScroll}
- >
- {this.renderVideo()}
- </ScrollView>
- {/* Suggestions - End */}
- </ScrollView >
- </Drawer >
- );
- }
- }
- // Customizable Area End
- // Customizable Area Start
- const styles = StyleSheet.create({
- scrollView: {
- flexGrow: 1,
- // height: Platform.OS === "web" ? '100vh' : 'auto',
- backgroundColor: "#F5FCFF",
- },
- Header: {
- flexDirection: 'row',
- justifyContent: 'space-between',
- width: '92%',
- height: height / 7,
- alignItems: 'center',
- alignSelf: 'center'
- },
- Text1: {
- fontSize: 20,
- fontWeight: '500',
- lineHeight: 30,
- color: '#FFFFFF'
- },
- Text2: {
- fontSize: 20,
- fontWeight: '700',
- lineHeight: 30,
- color: '#FFFFFF',
- left: '10%'
- },
- boxContainer: {
- height: Scale(45),
- width: '58%',
- // backgroundColor: '#9D90D0',
- borderRadius: 10,
- bottom: 4,
- alignItems: 'center',
- borderWidth: 0
- },
- box1: {
- height: Scale(32),
- width: '85%',
- backgroundColor: '#ffff',
- borderRadius: 10,
- borderColor: '#0080BE',
- borderWidth: 1,
- flexDirection: 'row',
- justifyContent: 'flex-start',
- alignItems: 'center',
- position: 'absolute',
- top: 7.5,
- left: 9
- },
- btn: {
- flexDirection: 'row',
- justifyContent: 'flex-start',
- alignItems: 'center',
- margin: 10,
- },
- edit: {
- tintColor: '#0080BE',
- height: height / 33,
- width: width / 20,
- },
- editText: {
- color: '#0080BE',
- left: 7,
- fontWeight: '700',
- fontSize: 12,
- flex: 1,
- flexWrap: 'wrap'
- },
- box2: {
- height: Scale(32),
- width: '40%',
- backgroundColor: '#ffff',
- borderRadius: 10,
- borderColor: '#0080BE',
- borderWidth: 1,
- flexDirection: 'row',
- // justifyContent: 'center',
- alignItems: 'center',
- justifyContent: 'flex-start',
- // top: 7.5,
- right: 5,
- top: 4,
- },
- taskSquare: {
- tintColor: '#0080BE',
- height: height / 33,
- width: width / 20
- },
- taskSquareText: {
- color: '#0080BE',
- fontWeight: '700',
- fontSize: 12,
- left: 5
- },
- mainexportBox: {
- flexDirection: 'row',
- justifyContent: 'space-between',
- height: height / 3.5,
- width: '92%',
- alignSelf: 'center',
- },
- boxHeader: {
- height: Scale(185),
- width: '46%',
- backgroundColor: '#EAF9FF',
- borderRadius: 12,
- borderColor: '#95D5F4',
- borderWidth: 3,
- elevation: 5,
- },
- exportText: {
- flexDirection: 'row',
- height: Scale(35),
- top: 10
- },
- exportText2: {
- flexDirection: 'row',
- // height: Scale(25),
- marginLeft: 10,
- marginEnd: 1
- },
- TextHeader: {
- fontSize: 14,
- fontWeight: '500',
- lineHeight: 21,
- color: '#484848',
- height: Scale(40)
- },
- TextPoints: {
- fontSize: 11,
- fontWeight: '500',
- lineHeight: 21,
- color: '#0080BE'
- },
- exportImage: {
- top: 4,
- right: 3
- },
- centeredView: {
- flex: 1,
- justifyContent: "center",
- alignItems: "center",
- backgroundColor: "#fff",
- },
- modalView: {
- margin: 20,
- backgroundColor: "#fff",
- borderRadius: 20,
- padding: 35,
- alignItems: "center",
- height: '40%',
- borderWidth: 1,
- width: '90%'
- },
- buttonClose: {
- backgroundColor: "#2196F3",
- width: '90%',
- height: 40
- },
- textStyle: {
- color: "#fff",
- fontWeight: "bold",
- textAlign: "center"
- },
- buttonStyle: {
- backgroundColor: "#2196F3",
- width: '95%',
- height: 40,
- borderRadius: 10,
- alignItems: 'center',
- justifyContent: 'center',
- top: 15
- },
- modalText: {
- marginBottom: 15,
- textAlign: "center",
- fontSize: 18,
- fontWeight: '700'
- },
- tableBox: {
- borderWidth: 0.1,
- borderRadius: 18,
- borderColor: "#979797",
- // padding: 15,
- // marginVertical: 10,
- backgroundColor: "#fff",
- margin: 10,
- padding: 10,
- elevation: 10,
- // height: Scale(90),
- },
- actionItemContainer: {
- padding: "4%"
- },
- row: {
- flexDirection: "row",
- alignItems: "center",
- justifyContent: "space-between",
- width: "100%"
- },
- rowItem: {
- width: "50%"
- },
- actionButton: {
- width: "45%",
- paddingVertical: Scale(8),
- height: dimensions.hp(5),
- marginBottom: 0
- },
- actionButtonText: {
- fontSize: Scale(14)
- },
- actionRow: {
- padding: dimensions.wp(5),
- borderWidth: 1,
- borderRadius: dimensions.wp(3),
- flexDirection: "row",
- alignItems: "center",
- marginHorizontal: dimensions.wp(4),
- elevation: 5,
- marginBottom: dimensions.hp(2)
- },
- activeActionRow: {
- backgroundColor: "#DFFEDF",
- borderColor: Colors.green
- },
- inActiveActionRow: {
- borderColor: `${Colors.red}66`,
- backgroundColor: Colors.white
- },
- actionCheckbox: {
- height: dimensions.hp(2.5),
- width: dimensions.hp(2.5),
- borderRadius: dimensions.hp(1.25),
- marginRight: dimensions.wp(4)
- },
- activeActionCheckbox: {
- backgroundColor: Colors.green
- },
- inactiveActionCheckbox: {
- backgroundColor: Colors.borderColor
- },
- actionText: {
- width: dimensions.wp(72)
- },
- moreLink: {
- borderBottomColor: Colors.text,
- borderBottomWidth: 1
- },
- block: {
- paddingHorizontal: "4%"
- },
- horizontalScroll: {
- paddingLeft: dimensions.wp(4),
- paddingRight: 0
- },
- article: {
- elevation: 4,
- marginRight: dimensions.wp(3),
- width: dimensions.wp(30),
- height: dimensions.wp(50),
- position: "relative"
- },
- articleImage: {
- position: "absolute",
- top: "-10%",
- left: "-10%",
- width: "120%",
- height: "120%",
- resizeMode: "contain"
- },
- audioWrapper: {
- marginRight: dimensions.wp(5),
- marginBottom: dimensions.hp(2)
- },
- audio: {
- width: dimensions.wp(28),
- height: dimensions.wp(28),
- borderRadius: dimensions.wp(3),
- borderWidth: 3,
- borderColor: "#c9c2f2",
- alignItems: "center",
- justifyContent: "center",
- marginBottom: dimensions.hp(1),
- backgroundColor: Colors.white
- },
- audioPlay: {
- width: dimensions.wp(12),
- height: dimensions.wp(12),
- borderRadius: dimensions.wp(6),
- alignItems: "center",
- justifyContent: "center",
- backgroundColor: Colors.accent,
- borderWidth: 3,
- borderColor: "#c6c6c6"
- },
- audioIcon: {
- width: dimensions.wp(5),
- height: dimensions.wp(5),
- resizeMode: "contain",
- tintColor: Colors.white
- },
- videoBlock: {
- width: dimensions.wp(70),
- height: dimensions.wp(45),
- borderRadius: dimensions.wp(3),
- borderWidth: 3,
- borderColor: "#c9c2f2",
- marginRight: dimensions.wp(4),
- marginBottom: dimensions.hp(1),
- overflow: "hidden"
- },
- thumbnail: {
- width: "100%",
- height: "100%",
- alignItems: "center",
- justifyContent: "center",
- },
- videoPlay: {
- width: dimensions.wp(15),
- height: dimensions.wp(15),
- borderRadius: dimensions.wp(7.5),
- alignItems: "center",
- justifyContent: "center",
- backgroundColor: "#867CCA",
- borderWidth: 3,
- borderColor: "#c6c6c6"
- },
- innerContainer: {
- justifyContent: "space-between",
- // justifyContent:'flex-end',
- alignItems: "center",
- flexDirection: "row",
- },
- checkIpSytle: {
- flexDirection: "row",
- backgroundColor: '#4793E0',
- // margin:10,
- flex: 1,
- justifyContent: 'flex-end',
- alignItems: "center",
- },
- title: {
- fontSize: 17,
- color: '#3E3E3E',
- textAlign: 'left',
- margin: 20,
- opacity: 1,
- backgroundColor: 'transparent',
- fontStyle: 'normal',
- fontWeight: 'normal',
- borderRadius: 19,
- marginLeft: 40,
- textAlignVertical: 'top',
- },
- Input: {
- color: Colors.text,
- fontSize: Scale(17)
- },
- mobileInput: {
- flexDirection: "column",
- alignItems: "stretch",
- fontSize: 16,
- textAlign: "left",
- backgroundColor: "#00000000",
- marginTop: 20,
- borderWidth: 1,
- borderColor: "#979797", //"#767676",
- borderRadius: 2,
- includeFontPadding: true,
- margin: 10
- },
- // drawer styling
- containerFilter: {
- flex: 1,
- backgroundColor: "#ffffff",
- },
- HomeContainer: {
- flex: 1,
- padding: 20,
- backgroundColor: "#ffffff",
- },
- headerImage: {
- flexDirection: "row",
- alignItems: "center"
- },
- ProfileImage: {
- width: Scale(80),
- height: Scale(80),
- borderRadius: Scale(40),
- resizeMode: "cover",
- borderColor: "#c2b2d8"
- },
- profileText: {
- fontSize: Scale(15),
- color: "#000",
- marginTop: Scale(10)
- },
- AccountText: {
- fontSize: Scale(15),
- color: "#000",
- marginLeft: Scale(20),
- },
- profileFirstText: {
- color: "gray",
- fontSize: Scale(15)
- },
- ProfileTextHeader: {
- marginLeft: Scale(20)
- },
- line: {
- width: Scale(210),
- height: Scale(1),
- borderWidth: Scale(0.3),
- borderColor: "#DDD",
- marginTop: Scale(30),
- alignSelf: "center"
- },
- account: {
- width: Scale(20),
- height: Scale(20),
- resizeMode: "contain",
- tintColor: "#8c69c6"
- },
- accoutHeader: {
- flexDirection: "row",
- alignItems: "center",
- marginTop: Scale(20)
- },
- scrollViewstyle: {
- marginTop: 20,
- width: 120 * 2,
- height: 120,
- },
- contentContainer: {
- justifyContent: 'center',
- alignItems: 'center',
- // backgroundColor: 'lightgrey',
- paddingBottom: 50
- },
- container: {
- flex: 1,
- // justifyContent: 'center',
- // alignItems: 'center',
- // backgroundColor: '#F5FCFF',
- },
- SquareShapeView: {
- width: 120 * 2,
- height: 120,
- backgroundColor: '#00BCD4'
- },
- paragraph: {
- margin: 24,
- fontSize: 18,
- fontWeight: 'bold',
- textAlign: 'center',
- },
- });
- // Customizable Area End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement