From 1b3390f1b9ab216f7b9c69ae4c8c06a9e762ec5f Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Mon, 29 Apr 2019 16:21:03 +0530 Subject: [PATCH] Load data from Redux state --- .../react-app/src/components/AppList.js | 29 +++++++++---------- .../react-app/src/js/reducers/index.js | 17 ++++++++++- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/AppList.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/AppList.js index 0c2b611cd2..728fff0382 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/AppList.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/AppList.js @@ -1,30 +1,25 @@ import React from "react"; import AppCard from "./AppCard"; import {Col, Row} from "antd"; +import {connect} from "react-redux"; -class AppList extends React.Component { +// connecting state.articles with the component +const mapStateToProps= state => { + return {apps : state.apps} +}; + + +class ConnectedAppList extends React.Component { constructor(props) { super(props); - this.state = { - apps: [ - { - id: 1, - title: 'Hi', - platform: 'android', - description: 'lorem', - subType: 'FREE', - type: 'ENTERPRISE' - } - ] - } } render() { return ( - {this.state.apps.map(app => ( - - ( + +