loaded releases in modal (basic view)

feature/appm-store/pbac
Jayasanka 6 years ago
parent 9843e6f0e2
commit 9dc007c1da

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import {Modal, Typography} from 'antd'; import {Modal, Typography,List, Avatar} from 'antd';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
// connecting state.releaseView with the component // connecting state.releaseView with the component
@ -17,6 +17,7 @@ class ConnectedReleaseModal extends React.Component {
app: null app: null
}; };
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (nextProps !== this.props) { if (nextProps !== this.props) {
this.setState({ this.setState({
@ -46,19 +47,29 @@ class ConnectedReleaseModal extends React.Component {
render() { render() {
if (this.props.releaseView.app != null) { if (this.props.releaseView.app != null) {
const app = this.props.app; const app = this.props.releaseView.app;
return ( return (
<div> <div>
<Modal <Modal
title={app.title} title={app.name}
visible={this.state.visible} visible={this.state.visible}
onOk={this.handleOk} onOk={this.handleOk}
onCancel={this.handleCancel} onCancel={this.handleCancel}
> >
<p>Some contents...</p> <p>Some contents...</p>
<p>Some contents...</p> <List
<p>Some contents...</p> itemLayout="horizontal"
dataSource={app.applicationReleases}
renderItem={item => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src={item.iconPath} />}
title={<a href="https://ant.design">Title</a>}
description={item.description}
/>
</List.Item>
)}
/>
</Modal> </Modal>
</div> </div>
); );

Loading…
Cancel
Save