{this.props.portfolioName}
-{this.props.portfolioName}
+-
- {links.map((link, i) =>
-
-
+ {links.map((link, i) =>
+
diff --git a/src/App.jsx b/src/App.jsx index 83a8543..ef2383a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -3,73 +3,40 @@ import MyHeader from './component/MyHeader'; import Footer from './component/Footer'; import MySidebar from './component/MySidebar'; import MainContent from './component/MainContent'; +import AppContextProvider from './component/AppContextProvider'; +import AppContext from './component/AppContext'; import './component/fontLibrary'; -import * as utils from './component/Utils' class App extends Component { constructor(props) { super(props); this.state = { - portfolioName: "Retirement", - startDate: utils.yesterdayDate(), - endDate: utils.todayDate(), - data: null + portfolioName: "Retirement" } - this.portfolioChange = this.handlePortfolioChange.bind(this); - this.handlePeriodChange = this.handlePeriodChange.bind(this); - } - - handlePortfolioChange(name) { - this.setState({ - portfolioName: name - }); - } - - handlePeriodChange(startDate, endDate) { - this.setState({ - startDate: startDate, - endDate: endDate - }, - () => this.fetchServiceData()); - - } - - fetchServiceData() { - // const data = JSON.parse(utils.mockAssetzService()); - // console.log(data) - // this.setState({ - // data: data - // }); - //uncomment below in production. - fetch('http://192.168.0.112:8080/assets?startDate=' + this.state.startDate + "&endDate=" + this.state.endDate) - .then(res => res.json()) - .then((data) => { - this.setState({ data: data }) - }) - .catch(console.log) - } - - componentDidMount() { - this.fetchServiceData(); } render() { - const { portfolioName, data } = this.state; return ( -