Skip to content

Commit

Permalink
Merge pull request meshery#8703 from dhiraj0911/dhiraj
Browse files Browse the repository at this point in the history
Refactor /management/index.js to functional component
  • Loading branch information
Yashsharma1911 authored Sep 15, 2023
2 parents 5b47548 + e71970c commit 3746214
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions ui/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import { NoSsr } from "@material-ui/core";
import Head from 'next/head';
import React from "react";
import React, { useEffect } from "react";
import { connect } from "react-redux";
import { bindActionCreators } from 'redux';
import DashboardComponent from "../components/DashboardComponent";
import { getPath } from "../lib/path";
import { updatepagepath } from "../lib/store";

class Index extends React.Component {
componentDidMount () {
function Index(props) {
useEffect(() => {
console.log(`path: ${getPath()}`);
this.props.updatepagepath({ path : getPath() });
}
props.updatepagepath({ path : getPath() });
}, []);

render () {
return (
<NoSsr>
<Head>
<title>Dashboard | Meshery</title>
</Head>
<DashboardComponent />
</NoSsr>
);
}
return (
<NoSsr>
<Head>
<title>Dashboard | Meshery</title>
</Head>
<DashboardComponent />
</NoSsr>
);
}

const mapDispatchToProps = dispatch => ({ updatepagepath : bindActionCreators(updatepagepath, dispatch) })

export default connect(
null,
mapDispatchToProps
)(Index);
)(Index);

0 comments on commit 3746214

Please sign in to comment.