From aff32cc31bfc2f174af5ffcaf8793f44bf56f171 Mon Sep 17 00:00:00 2001 From: AravindM Date: Fri, 18 May 2018 22:44:55 +0530 Subject: [PATCH] changed from props to state --- src/App.js | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index 6335570..f52da5a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,6 +1,9 @@ import React, {Component} from 'react'; +import logo from './logo.svg'; import './App.css'; import Me from "./Me"; +import ClassComponentBasics from "./ClassComponentBasics"; +import Counter from "./Counter"; class App extends Component { @@ -8,17 +11,71 @@ class App extends Component { constructor(props) { super(props); + + this.state = { + // doShowLesson: false + showCounter: true, + data: { + firstName: 'Aravind', + lastName: 'M', + image: '', + details: [ + { + id:1, + provider: 'facebook', + username: 'mak11195', + engagement: ['personal'], + link: '' + }, + { + id:2, + provider: 'github', + username: 'makaravind', + engagement: ['professional'], + link: 'https://github.com/makaravind' + }, + { + id:3, + provider: 'gmail', + username: 'aravindmetku@gmail.com', + engagement: ['professional', 'personal'], + }, + { + id:4, + provider: 'youtube', + channel: 'amyourmove', + url: 'youtube.com/c/amyourmove', + engagement: ['professional'], + }, + { + id:5, + provider: 'wordpress', + type: 'blog', + url: 'https://maravindblog.wordpress.com', + engagement: ['professional'], + } + ] + } + }; } + handleShowCounter = () => { + console.log('handleShowCounter'); + this.setState(currentState => { + return {showCounter: false} + }) + }; + render() { return (
- logo -

Welcome {this.props.data.firstName} - {this.props.data.lastName}

+ logo +

Welcome {this.state.data.firstName} + {this.state.data.lastName}

- + + {/*{ this.state.showCounter && }*/}
); }