Change routes in store

feature/appm-store/pbac
Jayasanka 6 years ago
parent 336612904b
commit 164b3415ae

@ -32,7 +32,7 @@ class ConnectedAppCard extends React.Component {
const description = (
<div className="appCard">
<Link to={"/store/"+app.deviceType+"/" + release.uuid}>
<Link to={"/store/"+app.deviceType+"/apps/" + release.uuid}>
<Row className="release">
<Col span={24} className="release-icon">
<img src={release.iconPath} alt="icon"/>

@ -101,10 +101,10 @@ class ReleaseView extends React.Component {
<img src={release.iconPath} alt="icon"/>
</Col>
<Col xl={10} sm={11} className="release-title">
<Title level={2}>App Name</Title>
<Title level={2}>{app.name}</Title>
<Text>Version : {release.version}</Text><br/><br/>
<StarRatings
rating={release.rating}
rating={app.rating}
starRatedColor="#777"
starDimension="20px"
starSpacing="2px"

@ -6,7 +6,6 @@ import Login from "./pages/Login";
import Dashboard from "./pages/dashboard/Dashboard";
import Apps from "./pages/dashboard/apps/Apps";
import Release from "./pages/dashboard/apps/release/Release";
import AddNewApp from "./pages/dashboard/add-new-app/AddNewApp";
import './index.css';
import store from "./js/store/index";
import {Provider} from "react-redux";
@ -24,17 +23,12 @@ const routes = [
component: Dashboard,
routes: [
{
path: '/store/android',
path: '/store/:deviceType',
component: Apps,
exact: true
},
{
path: '/store/apps/new-app',
component: AddNewApp,
exact: true
},
{
path: '/store/android/:uuid',
path: '/store/:deviceType/apps/:uuid',
exact: true,
component: Release
}

@ -18,6 +18,9 @@ class Dashboard extends React.Component {
}
render() {
const {deviceType} = this.props.match.params;
console.log(this.props.match.params);
console.log(deviceType);
return (
<div>
<Layout className="layout">
@ -28,12 +31,12 @@ class Dashboard extends React.Component {
<Menu
theme="light"
mode="horizontal"
defaultSelectedKeys={['1']}
defaultSelectedKeys={["android"]}
style={{lineHeight: '64px'}}
>
<Menu.Item key="1"><Link to="/store/android"><Icon type="android" theme="filled"/>Android</Link></Menu.Item>
<Menu.Item key="2"><Link to="/store/apps"><Icon type="apple" theme="filled"/>iOS</Link></Menu.Item>
<Menu.Item key="3"><Link to="/store/apps/new-app"><Icon type="upload"/>Web Clips</Link></Menu.Item>
<Menu.Item key="android"><Link to="/store/android"><Icon type="android" theme="filled"/>Android</Link></Menu.Item>
<Menu.Item key="ios"><Link to="/store/ios"><Icon type="apple" theme="filled"/>iOS</Link></Menu.Item>
<Menu.Item key="webclip"><Link to="/store/webclips"><Icon type="upload"/>Web Clips</Link></Menu.Item>
</Menu>
</Header>
</Layout>

@ -26,6 +26,7 @@ class Release extends React.Component {
}
componentDidUpdate(prevProps, prevState, snapshot) {
const {uuid} = this.props.match.params;
if (prevProps !== this.props) {
this.fetchData(uuid);
}

Loading…
Cancel
Save