render() { if(stores.systemStore.preferToScroll == true){ return( {this._renderRegisterDeviceModal} item.id} key = {( stores.systemStore.preferToScroll ) ? 1 : 0} numColumns={1} extraData={stores.databaseStore.isLoadingSites} onRefresh={() => this.onRefresh()} refreshing={false} renderItem={({item}) => this._renderFlatListItem(item)} ItemSeparatorComponent={this._renderSeparator} ListHeaderComponent={this._renderHeader} ListFooterComponent={this._renderFooter} /> ) }else{ return( {this._renderRegisterDeviceModal} item.id} key = {( stores.systemStore.preferToScroll ) ? 1 : 0} numColumns={stores.systemStore.gridColumns} extraData={stores.databaseStore.isLoadingSites} onRefresh={() => this.onRefresh()} refreshing={false} renderItem={({item}) => this._renderGridItem(item)} ItemSeparatorComponent={this._renderSeparator} ListHeaderComponent={this._renderHeader} ListFooterComponent={this._renderFooter} /> ) } } _renderRegisterDeviceModal(){ welcomeDeviceFarmName = `Farm: {stores.systemStore.activeGroup.name}` welcomeDeviceText = "Please register your name for access to the PivoTrac servers" return ( {welcomeDeviceFarmName} {welcomeDeviceText} this.setState({deviceIdentity})} placeholder = {this.state.deviceIdentity} placeholderTextColor="#808080" style={styles.input} />