import React, { useEffect, useState } from "react"; import { Text, View, StyleSheet, TouchableOpacity, Image, FlatList, Dimensions, NativeModules, Platform, DeviceEventEmitter, } from "react-native"; import SearchableHeader from "common/components/SearchableHeader"; import colors from "res/colors"; import { isLandscapeMode, isTablet } from "common/utils/DimensionUtils"; import moment from "moment"; import { widthPercentageToDP as wp, heightPercentageToDP as hp, } from "react-native-responsive-screen"; import strings from "res/strings"; import images from "res/images"; import { fetchExtraDataforNestedItemsViaFolderId, getAssignedComponentData, getAssignmentComponentData, } from "common/apis"; import { AuthTypes, NavParams } from "common/Enums"; import AsyncStorage from "@react-native-community/async-storage"; import { APP_DATA_PROPS, GAME_ID, IS_GAME_LAUNCHED, LAST_ROUTE_NAME, SOURCE_GAME_DATA, } from "../constants"; import * as KeychainHelper from "common/utils/KeychainHelper"; import { ROUTES } from "common/routes/RouteConst"; import FolderItem from "common/components/FolderItem"; import PracticeSetItem from "common/components/PracticeSetItem"; import ManageNavigation from "../common/components/ManageNavigation"; import { getBaseUrlForMedia, getConnfigDetailForOrgIdUserAuth, removeAllUnwantedKeys, } from "../common/utils/CommonMethod"; import StratagemClient from "../common/networking/StratagemClient"; import RootNavigation from "../common/routes/RootNavigation"; import KeycloakClient from "common/networking/KeycloakClient"; import { NavigationScreenProp } from "react-navigation"; import LoaderIndicator from "common/components/LoaderIndicator"; const { ManageReactViewController } = NativeModules; const activityStarter = NativeModules.ActivityStarter; const isLandscape = isLandscapeMode(); interface Props { PracticeSetdata: Object; authType: string; stratagemClient: StratagemClient; keycloakClient: KeycloakClient; navigation: NavigationScreenProp; } interface State { searchQuery: string; isLandscape: boolean; assignmentrender: boolean; breadcrumb: string[]; otherData: string[]; assignData: any[]; LoopedAssignmentArrayData: any[]; breadcrumbtail: string; analyticsUrl: string; orientation: string; dateformat: string; nestData: []; details: { id: string; fol: Number; pc: Number }; dateDisplay: {}; currentSelectedGame: string; isGameLoading: boolean; } var myRef = React.createRef(null); class AssignmentScreen extends React.Component { _isMounted = true; static defaultProps = { style: {}, isRecentlyPlayedFolder: false, authType: AuthTypes.CLIENT_AUTH, isPracticeSetEditable: "", }; constructor(props: Props) { super(props); this.props = props; this.state = { searchQuery: "", isLandscape: isLandscapeMode() ? true : false, assignmentrender: true, breadcrumb: [ props.navigation.state.params.foldersCount == 0 ? props.navigation.state.params.practiceSetsCount + " Practice Sets" : props.navigation.state.params.practiceSetsCount == 0 ? props.navigation.state.params.foldersCount + " Folders" : props.navigation.state.params.foldersCount + " Folders and " + props.navigation.state.params.practiceSetsCount + " Practice Sets", ], details: { fol: props.navigation.state.params.foldersCount, pc: props.navigation.state.params.practiceSetsCount, id: props.navigation.state.params.assignmentId, }, otherData: [], assignData: [], isGameLoading: false, nestData: [], LoopedAssignmentArrayData: [], breadcrumbtail: props.navigation.state.params.foldersCount == 0 ? props.navigation.state.params.practiceSetsCount + " Practice Sets" : props.navigation.state.params.practiceSetsCount == 0 ? props.navigation.state.params.foldersCount + " Folders" : props.navigation.state.params.foldersCount + " Folders and " + props.navigation.state.params.practiceSetsCount + " Practice Sets", analyticsUrl: props.navigation.getParam(NavParams.ANALYTICS_URL), orientation: isLandscapeMode() ? "Landscape" : "Portrait", dateDisplay: true, dateformat: moment( props.navigation.state.params.dueDate.toString() ).format("DD MMM YYYY"), currentSelectedGame: props.navigation.getParam(NavParams.SELECTED_GAME), }; } componentDidMount() { this._isMounted = true; if (this._isMounted) { const { navigation } = this.props; const { currentSelectedGame } = this.state; navigation.setParams({ currentSelectedGame }); this.getAssignmentData(); this.getAssignedContentData(navigation.state.params.assignmentId, 0); this.getOrientation(); Dimensions.addEventListener("change", () => { this.getOrientation(); }); if (Platform.OS === "android") { try { DeviceEventEmitter.addListener( "customEventName", async function (e: Event) { if (e) { AsyncStorage.setItem(IS_GAME_LAUNCHED, "0"); const lastroute = await AsyncStorage.getItem(LAST_ROUTE_NAME); const temp = JSON.parse(lastroute); if (Array.isArray(temp) && temp.length > 0 && temp[0].route) { if (Platform.OS === "android") { this.props.navigation.navigate( temp[0].route, temp[0]?.params ); } else { return this.props.navigation.navigate("Loading"); } } else { return this.props.navigation.navigate("HomeStack"); } } } ); } catch (err) { console.log(err); } } else { // this.NavigatetoLastComponent() } } } NavigatetoLastComponent = async () => { // async route + parms AsyncStorage.setItem(IS_GAME_LAUNCHED, "0"); const lastroute = await AsyncStorage.getItem(LAST_ROUTE_NAME); const temp = JSON.parse(lastroute); if (Array.isArray(temp) && temp.length > 0 && temp[0].route) { if (Platform.OS === "android") { this.props.navigation.navigate(temp[0].route, temp[0]?.params); } else { return this.props.navigation.navigate("Loading"); } } else { return this.props.navigation.navigate("HomeStack"); } }; getOrientation = () => { if (myRef) { if (Dimensions.get("window").width < Dimensions.get("window").height) { this.setState({ orientation: "portrait" }); } else { this.setState({ orientation: "landscape" }); } } }; getAssignmentData = async () => { try { // first fetching from local if exists. await this.getAssignmentDatafromAPI(); } catch (e) { console.log("e->" + e); } }; AssignmentDatafromLocal = async () => { try { const temp = await AsyncStorage.getItem(ROUTES.ASSIGNMENTS); if (temp) { const data = JSON.parse(temp); if ( data && data?.Assignments && Array.isArray(data.Assignments) && data.Assignments.length > 0 ) { return this.setState({ otherData: data.Assignments }); } else { // getting assigment data from API // return this.getAssignmentDatafromAPI(); } } else return this.getAssignmentDatafromAPI(); } catch (error) { console.log("err2=>", error); this.getAssignmentDatafromAPI(); } }; getAssignmentDatafromAPI = async () => { try { const temp = await getAssignmentComponentData(""); if ( temp && temp.Assignments && Array.isArray(temp.Assignments) && temp.Assignments.length > 0 ) { this.setState({ otherData: temp.Assignments }); // // this.SortDummyData(data); } } catch (e) { console.log("getAssignmentDatafromAPI error", e); } }; handleBreadCrumbFeature = (type: number, item: string) => { if (type === 0) { return this.setState({ assignData: this.state.LoopedAssignmentArrayData, breadcrumbtail: this.props.navigation.state.params.foldersCount == 0 ? this.props.navigation.state.params.practiceSetsCount + " Practice Sets" : this.props.navigation.state.params.practiceSetsCount == 0 ? this.props.navigation.state.params.foldersCount + " Folders" : this.props.navigation.state.params.foldersCount + " Folders and " + this.props.navigation.state.params.practiceSetsCount + " Practice Sets", breadcrumb: [ this.props.navigation.state.params.foldersCount == 0 ? this.props.navigation.state.params.practiceSetsCount + " Practice Sets" : this.props.navigation.state.params.practiceSetsCount == 0 ? this.props.navigation.state.params.foldersCount + " Folders" : this.props.navigation.state.params.foldersCount + " Folders and " + this.props.navigation.state.params.practiceSetsCount + " Practice Sets", ], dateDisplay: true, }); } else { console.log("folder name=>", item); this.findChildFolderRecursiveCall( this.state.LoopedAssignmentArrayData, item ); } }; // recursive function to add child folder content to its respective folder id ContentforChildFolderRecursiveCall = ( arrayInput: any[], folderId: string, newarr: any[] ) => { arrayInput.forEach((el, index) => { if (el?.folderId === folderId) { if (!el?.folder_child) { let newObj = { ...el, folder_child: newarr }; arrayInput.splice(index, 1, newObj); } } else if (el?.folder_child) { this.ContentforChildFolderRecursiveCall( el?.folder_child, folderId, newarr ); } }); this.setState({ LoopedAssignmentArrayData: arrayInput }); }; findChildFolderRecursiveCall = (arrayInput: any[], folderName: string) => { let breadcrumbTemp = [...this.state.breadcrumb]; console.log( "hello=>", breadcrumbTemp, breadcrumbTemp.length - breadcrumbTemp.indexOf(folderName) ); // remove further elements from breadcrumb // breadcrumbTemp.splice( // breadcrumbTemp.indexOf(folderName), // breadcrumbTemp.length // ); let index = breadcrumbTemp.indexOf(folderName); breadcrumbTemp.splice(index + 1, breadcrumbTemp.length - (index + 1)); console.log("new breadcrumbTemp", breadcrumbTemp); this.setState({ breadcrumb: breadcrumbTemp }); arrayInput.forEach((el, index) => { if (el?.name === folderName) { if (el?.folder_child) { this.setState({ assignData: el.folder_child }); } } }); }; getAssignedContentData = async (str: string, index?: number) => { try { const temp = await getAssignedComponentData(null, str); if (temp && temp.status === 200) { const { data } = temp; if ( data.folders && Array.isArray(data.folders) //&& data.folders.length > 0 ) { //this.setState({ assignData: data }); const arr1 = data.folders; const arr2 = data.practiceSets; const setTempdata = arr1.concat(arr2); //console.log("hey ya-->" + JSON.stringify(setTempdata)); if (index == 0) { this.setState({ LoopedAssignmentArrayData: setTempdata }); } this.setState({ assignData: setTempdata }); } else if (data == "") { this.setState({ assignData: [] }); } } if (temp?.status === 401) { console.log("err"); } else { return null; } } catch (e) { console.log("e->" + e); } }; getNestedData = async (folderId: string, name: string) => { try { const data = await fetchExtraDataforNestedItemsViaFolderId( folderId, null ); //data has following structure: // {ps:[], f:[]} const arr1 = data.folders; const arr2 = data.practiceSets; const setTempdata2 = arr1.concat(arr2); this.ContentforChildFolderRecursiveCall( this.state.LoopedAssignmentArrayData, folderId, setTempdata2 ); let temp = [...this.state.breadcrumb]; temp.push(name); this.setState({ breadcrumbtail: name, }); this.setState({ breadcrumb: temp, }); this.setState({ assignData: setTempdata2, }); this.setState({ dateDisplay: false }); } catch (e) { console.log(e); // this.setState({ breadcrumb.push("hello") }) } }; abbreviateName = (name: string) => { const words = name.split(" "); let abbreviation = ""; if (words.length === 1) { const word = words[0]; if (word.length > 1) { abbreviation = words[0].substring(0, 2); } else { abbreviation = word; } } else { abbreviation = words[0].charAt(0) + words[1].charAt(0); } return abbreviation; }; formatData = (data, numColumns) => { const numberOfFullRows = Math.floor(data.length / numColumns); let numberOfElementsLastRow = data.length - numberOfFullRows * numColumns; while ( numberOfElementsLastRow !== numColumns && numberOfElementsLastRow !== 0 ) { data.push({ key: `blank-${numberOfElementsLastRow}`, empty: true }); numberOfElementsLastRow++; } return data; }; onclickSucess = async (item: object) => { this.setState({ isGameLoading: true }); // return console.log("item", item); const { navigation } = this.props; console.log("item", item); try { let localdata = await AsyncStorage.getItem(APP_DATA_PROPS); const _AppData = await JSON.parse(localdata); console.log("_AppData", _AppData); const authType = _AppData[NavParams.AUTH_TYPE]; const keycloakClient = _AppData[NavParams.KEYCLOAK_CLIENT]; const stratagemClient = _AppData[NavParams.STRATAGEM_CLIENT]; const configDict = { baseUrl: _AppData[NavParams.STRATAGEM_CLIENT].baseStratagemURL, authUrl: _AppData[NavParams.KEYCLOAK_CLIENT].authURL, analyticsId: _AppData[NavParams.ANALYTICS_ID], analyticsUrl: _AppData[NavParams.ANALYTICS_URL], }; const isGameHiddenApi = _AppData[NavParams.IS_GAME_HIDDEN_API]; const selectedGame = _AppData[NavParams.SELECTED_GAME]; const currentSelectedGame = _AppData[NavParams.SELECTED_GAME]; let folderID: ""; let folderName: ""; const gameID = await AsyncStorage.getItem(GAME_ID); let leaderboardID = ""; let referenceID = ""; let createdTime = ""; let dataSetID = ""; let practiceSet = { color: item.color, columnWidths: {}, createdTime: "", dataSetID: "", endTime: "", folder: { childFolders: [], columnWidths: {}, createdTime: "", endTime: "", id: "", name: "", parentFolder: "null", single0rgApp: false, }, gameID, id: item?.setID ? item?.setID : item?.setId, leaderboardID, learn: [], master: [], name: item?.name ?? "", referenceID, review: [], status: item?.status ?? "Pending", singleOrgApp: false, }; let gameobject = { authType, configDict, currentSelectedGame, folderID: "", folderName: "", folderdata: null, isGameHiddenApi, keycloakClient, practiceSet, selectedGame, stratagemClient, }; // temp["practiceSet"] = new_ps; await this.SnapshotLastComponent(); await this.getAsyncStorageData(item, "", gameobject); } catch (e) { this.setState({ isGameLoading: false }); console.log("onclickSucess", e); } }; SnapshotLastComponent = async () => { await RootNavigation.SaveLastRouteName( this.props.navigation.state.routeName, this.props.navigation.state.params ); }; getAsyncStorageData = async ( practiceSet: Object, selectedMenuName: string, _game_data: object // practiceSetSessionStatus: Object, ) => { console.log("ps", practiceSet); const liveGameId = "1"; const navigation = navigation; console.log("getAsyncStorageData->", _game_data); let allDataDict = {}; try { const stratagemClient = _game_data[NavParams.STRATAGEM_CLIENT]; const authType = _game_data[NavParams.AUTH_TYPE]; const currentGameId = await AsyncStorage.getItem(GAME_ID); const configDetail = _game_data.configDict; let OSSpecificDir = getBaseUrlForMedia(authType); const selectedName = typeof selectedMenuName === "string" ? selectedMenuName : ""; let liveSessionData, gameId; if (typeof selectedMenuName === "string") { liveSessionData = {}; gameId = currentGameId; } else { liveSessionData = selectedMenuName; liveSessionData.gameID = liveGameId; gameId = liveSessionData.gameID; } // try { /* if authtype is USER_AUTH & ORGID_USER_AUTH and typeof selectedMenuName is string then pass session value */ let sessionDataStatus = {}; let userDetail = {}; let getToken = ""; if ( (authType === AuthTypes.USER_AUTH || authType === AuthTypes.ORGID_USER_AUTH) && typeof selectedMenuName === "string" ) { } const allKeys = await AsyncStorage.getAllKeys(); const requiredKeys = removeAllUnwantedKeys(allKeys); const items = await AsyncStorage.multiGet(requiredKeys); const actual_User_Name = await AsyncStorage.getItem("actual_User_Name"); if (authType === AuthTypes.CLIENT_AUTH) { userDetail = { userName: stratagemClient.keycloakClient.clientID, password: stratagemClient.keycloakClient.clientPassword, actual_User_Name: actual_User_Name, }; getToken = await KeychainHelper.getSavedToken(authType); } else if (authType !== AuthTypes.CSV_PARSE) { // for iOS case get the value from the api method const credentials = await KeychainHelper.getUserCredentials(authType); if (credentials && credentials.username && credentials.password) { userDetail = { userName: credentials.username, password: credentials.password, token: credentials.accessToken, actual_User_Name: actual_User_Name, }; } } const orgId = _game_data[NavParams.KEYCLOAK_CLIENT].orgID; allDataDict = { // currentPracticeSetData: getCurrentDataObj, appData: items, isDrawerOpen: true, //for IOS , this value tells either we have already played the game or it newly mounted the appjs gameId, liveSessionData, sessionDataStatus, orgId, configDetail, userDetail, selectedPracticeSetData: { baseUrlForMedia: `${OSSpecificDir}/`.trim(), color: practiceSet.color, datasetID: "", //need to add later, folderID: "", foldername: "", leaderBoardID: "", practiceSetID: practiceSet.setID ?? practiceSet.setId, practicesetName: practiceSet.name, referenceID: "", //need to add later seletedMenuOption: "", // folderID: practiceSet?.folderID ? practiceSet.folderID : "", // foldername: practiceSet?.folderName ? practiceSet.folderName : "", // isTutorialForMatchGame: currentGameName === strings.home.matchGameTxt ? isTutorialActive : await AsyncStorage.getItem( // NavParams.IS_TUTORIAL_FOR_MATCH_GAME // ), // isTutorialForTriviaGame: currentGameName === strings.home.quizitiveGameTxt ? isTutorialActive : await AsyncStorage.getItem( // NavParams.IS_TUTORIAL_FOR_QUIZITIVE_GAME // ), // isTutorialForWordGame: currentGameName === strings.home.wordGameTxt ? isTutorialActive : await AsyncStorage.getItem( // NavParams.IS_TUTORIAL_FOR_WORD_GAME // ), stratgemToken: getToken, }, }; console.log("ready to pass the data->", allDataDict); if (Platform.OS === "ios") { this.setState({ isGameLoading: false }); ManageReactViewController.notifyEventToBaseClass(allDataDict); } else if (Platform.OS === "android") { // setLoader(false); // activityStarter.navigateToAnyApp(AndroidAppActivityNames.POC_SAMPLE_PROJECT, allDataDict.toString()); this.setState({ isGameLoading: false }); activityStarter.navigateToGame(JSON.stringify(allDataDict)); } } catch (e) { this.setState({ isGameLoading: false }); console.log("getAsyncStorageData", e); } }; render() { const props = this.props; const { navigation } = this.props; const { searchQuery, assignmentrender, breadcrumb, assignData, otherData } = this.state; // UTILS const getGameHiddenDict = navigation.getParam(NavParams.IS_GAME_HIDDEN_API); const authType = navigation.getParam(NavParams.AUTH_TYPE); const analyticsId = navigation.getParam(NavParams.ANALYTICS_ID); let configDict = {}; if (authType === AuthTypes.ORGID_USER_AUTH) { configDict = { baseUrl: navigation.getParam(NavParams.STRATAGEM_CLIENT) .baseStratagemURL, authUrl: navigation.getParam(NavParams.KEYCLOAK_CLIENT).authURL, analyticsId: analyticsId, analyticsUrl: navigation.getParam(NavParams.ANALYTICS_URL), }; } let isAnyGameEnable = false; if ( getGameHiddenDict?.isMatchGame === "1" || getGameHiddenDict?.isQuizitive === "1" || getGameHiddenDict?.isWordJumble === "1" ) { isAnyGameEnable = true; } else { isAnyGameEnable = false; } return ( { props.navigation.navigate("Home"); // props.navigation.goBack(); }} value={searchQuery} onChangeText={(text: string) => { this.setState({ searchQuery: text }); }} /> {/* View for breadcrumbs */} ( { {/* root breadcrumb */} {index == 0 ? ( { this.handleBreadCrumbFeature(0, item); }} > {this.state.breadcrumbtail == item ? ( {item} ) : ( {item} )} ) : ( {`>> `} {this.state.breadcrumbtail == item ? ( { this.handleBreadCrumbFeature(1, item); }} > {item} ) : ( this.handleBreadCrumbFeature(1, item) } > {item} )} )} } )} /> {this.state.dateDisplay == true ? ( ({this.state.dateformat}) ) : null} {/* ASSIGNMENT PRACTICESETS AND FOLDERS */} {this.state.orientation == "landscape" ? ( ( {/* FOLDER ITEMS */} {item.name ? ( item.folderId ? ( this.getNestedData(item.folderId, item.name) } /> ) : ( { this.onclickSucess(item); }} /> ) ) : null} )} numColumns={6} key={"1"} /> ) : ( ( {/* FOLDER ITEMS */} {item.name ? ( item.folderId ? ( this.getNestedData(item.folderId, item.name) } /> ) : ( { this.onclickSucess(item); }} /> ) ) : null} )} numColumns={4} key={"2"} /> )} {assignmentrender ? ( {strings.assignments.moreAssignments} {/* BOTTOM ASSIGNMENT COMPONENT */} Math.random()} indicatorStyle={"white"} removeClippedSubviews={false} // ListHeaderComponent={ // } renderItem={ ({ item }) => !( ( item.foldersCount == this.state.details.fol && item.practiceSetsCount == this.state.details.pc && item.assignmentId == this.state.details.id ) // item.foldersCount == // props.navigation.state.params.foldersCount && // item.practiceSetsCount == // props.navigation.state.params.practiceSetsCount && // item.assignmentId == // props.navigation.state.params.assignmentId // (console.log("item-->" + item), 1) ) ? ( { console.log(item.assignmentId); this.setState({ breadcrumbtail: item.foldersCount == 0 ? item.practiceSetsCount + " Practice Sets" : item.practiceSetsCount == 0 ? item.foldersCount + " Folders" : item.foldersCount + " Folders and " + item.practiceSetsCount + " Practice Sets", breadcrumb: [ item.foldersCount == 0 ? item.practiceSetsCount + " Practice Sets" : item.practiceSetsCount == 0 ? item.foldersCount + " Folders" : item.foldersCount + " Folders and " + item.practiceSetsCount + " Practice Sets", ], dateformat: moment( item.dueDate.toString() ).format("DD MMM YYYY"), details: { fol: item.foldersCount, pc: item.practiceSetsCount, id: item.assignmentId, }, }); this.getAssignedContentData(item.assignmentId, 0); // this.handleBreadCrumbFeature(0, item); } // this.props.navigation.navigate(ROUTES.ASSIGNMENTS, params) } style={{ borderColor: colors.assignmentborder, borderWidth: isTablet() ? 1.25 : 1.1, borderRadius: 10, padding: 15, margin: 10, width: isLandscape ? isTablet() ? wp(16) : wp(13) : !isTablet() ? hp(14) : hp(17), // isTablet() // ? heightPercentageToDP(16) // : heightPercentageToDP(12), height: isLandscape ? isTablet() ? wp(12.2) : wp(11) : !isTablet() ? hp(12) : hp(14.5), marginBottom: 20, marginHorizontal: isTablet() ? 20 : 10, }} > {/* */} {/* change */} {item.type == "assignment" ? ( ) : ( )} {/* for nested folder pass folder name */} {item.foldersCount == 0 ? " " + item.practiceSetsCount + " Practice Sets" : item.practiceSetsCount == 0 ? " " + item.foldersCount + " Folders" : item.foldersCount + " Folders and " + item.practiceSetsCount + " Practice Sets"} {/* for nested folder pass folder name */} {"Due Date:"} {/* for nested folder pass folder name */} {moment(item.dueDate.toString()).format( "DD MMM YYYY" )} ) : null // "Hi!" } /> ) : ( )} ); } } const styles = StyleSheet.create({ sectionHeaderContainer: { flexDirection: "row", justifyContent: "space-between", }, breadcrumbs: { flex: 1, flexDirection: "row", justifyContent: "space-between", alignItems: "center", }, sectionHeaderTextAssignment: { color: colors.home.textDark, fontFamily: "Montserrat-Bold", fontWeight: "600", // paddingHorizontal: 5, marginVertical: isTablet() ? 5 : 3, fontSize: isTablet() ? isLandscapeMode() ? wp(3) : hp(2) : !isLandscapeMode() ? hp(0.8) : wp(0.8), //isLandscape ? minH6(hp(4)) : minH6(wp(4)), textAlignVertical: "center", }, sectionHeaderText: { color: colors.home.textDark, fontFamily: "Montserrat-Bold", fontWeight: isTablet() ? "600" : "600", marginLeft: isTablet() ? 20 : 10, paddingVertical: 10, fontSize: isTablet() ? 20 : 12, textAlignVertical: "center", }, recentlyPlayedFolder: { marginTop: isLandscape ? hp(1) : wp(1), marginBottom: isLandscape ? hp(1.5) : wp(1.5), paddingHorizontal: 0, }, moreAssignmentsArea: { flex: 1, marginHorizontal: 5, paddingBottom: isTablet() ? isLandscapeMode() ? wp(2) : hp(2) //done : !isLandscapeMode() ? hp(1.6) //done : wp(0), marginTop: isTablet() ? 15 : 10, marginBottom: 5, }, leftside: { color: "#707070", fontFamily: "Montserrat-Medium", fontWeight: "500", // paddingHorizontal: 5, fontSize: isTablet() ? 16 : 10, marginLeft: isTablet() ? 25 : 15, // marginVertical: isTablet() ? 5 : 3, justifyContent: "center", alignItems: "center", }, leftside1: { color: "#707070", fontFamily: "Montserrat-Medium", fontWeight: "600", // paddingHorizontal: 5, fontSize: isTablet() ? 16 : 10, marginLeft: isTablet() ? 6 : 4, // marginVertical: isTablet() ? 5 : 3, justifyContent: "center", alignItems: "center", }, rightside: { color: "#707070", fontFamily: "Montserrat-Italic", fontWeight: "400", // paddingHorizontal: 5, fontSize: isTablet() ? 14 : 8, marginRight: 18, marginVertical: isTablet() ? 5 : 3, }, container: { flex: 1, justifyContent: "center", backgroundColor: "white", }, headerText: { fontSize: 20, textAlign: "center", margin: 10, fontWeight: "bold", }, GridViewContainer: { flex: 1, margin: isTablet() ? 20 : 15, justifyContent: "center", alignItems: "center", height: isTablet() ? isLandscapeMode() ? wp(14) : hp(17) : !isLandscapeMode() ? hp(15) : wp(11), // hp(17) : hp(15), //width: 100, //margin: 5, }, GridViewTextLayout: { fontSize: 20, fontWeight: "bold", justifyContent: "center", color: "#fff", padding: 10, }, // GridViewTextLayout3: { // fontSize: isTablet() // ? isLandscapeMode() // ? wp(2.5) // : hp(2.5) // : !isLandscapeMode() // ? hp(1.8) // : wp(1.8), // //isTablet() ? hp(2.5) : hp(1.8), // fontWeight: "bold", // justifyContent: "center", // alignItems: "center", // color: "#0076BB", // marginTop: isTablet() // ? isLandscapeMode() // ? wp(5.5) // : hp(5) // : !isLandscapeMode() // ? hp(3.5) // : wp(3.5), // // isTablet() ? hp(6) : hp(3.5), // marginLeft: isTablet() // ? isLandscapeMode() // ? wp(5.5) // : hp(3.75) // : !isLandscapeMode() // ? hp(2.5) // : wp(3.5), // //isTablet() ? hp(4.5) : hp(2.5), // }, GridViewTextLayout2: { fontSize: 20, fontWeight: "bold", justifyContent: "center", color: "black", padding: 10, }, practiceSetButton: { fontFamily: "Montserrat-Medium", fontWeight: "500", alignItems: "center", textAlign: "center", backgroundColor: "#C00ADC", overflow: "hidden", color: colors.home.textDark, fontSize: isLandscapeMode() ? hp(5.5) : wp(5.5), width: isLandscapeMode() ? hp(13) : wp(13), height: isLandscapeMode() ? hp(13) : wp(13), borderRadius: 5, paddingTop: isLandscapeMode() ? hp(13 / 4) : wp(13 / 4), textTransform: "uppercase", }, PracticeBtnSubContainer: {}, practiceSetandFolderText: { fontSize: isLandscape ? isTablet() ? wp(1.2) : wp(1) : !isTablet() ? hp(1.1) : hp(1.5), marginTop: isLandscape ? hp(0.75) : wp(0.75), fontFamily: "Montserrat-Medium", fontWeight: "500", alignItems: "center", textAlign: "center", color: "#707070", overflow: "hidden", }, dueDateText: { fontSize: isLandscape ? isTablet() ? wp(1.2) : wp(1) : !isTablet() ? hp(1.1) : hp(1.5), marginTop: isLandscape ? isTablet() ? wp(1) : wp(1) : !isTablet() ? hp(1.2) : hp(1.5), fontFamily: "Montserrat-Medium", fontWeight: "500", alignItems: "center", textAlign: "center", color: "#B5B5B5", overflow: "hidden", }, dateText: { fontSize: isLandscape ? isTablet() ? wp(1.2) : wp(1) : !isTablet() ? hp(1.1) : hp(1.5), // marginTop: isLandscape ? hp(0.25) : wp(0.25), marginBottom: isLandscape ? wp(1) : hp(0.5), fontFamily: "Montserrat-Medium", fontWeight: "600", alignItems: "center", textAlign: "center", color: "#0076BB", overflow: "hidden", }, }); export default AssignmentScreen;