From 0e96c8a16520e8f040929b86f742e7cd493cd969 Mon Sep 17 00:00:00 2001 From: CHILUKURI SRI HARSHA Date: Fri, 31 Dec 2021 23:37:27 +0530 Subject: [PATCH 1/5] Update App.js --- src/App.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index b9ef341..6ef47ef 100644 --- a/src/App.js +++ b/src/App.js @@ -14,6 +14,8 @@ class App extends React.Component { this.state = { theme:"dark", +NewYear:false, +time:"00h:00m:00s" } } onChangeTheme=()=>{ @@ -30,18 +32,35 @@ class App extends React.Component { console.log("%cYou are here probably because you know some code\nWant to discuss anything with me? Contact me at sharshach@gmail.com", "color:green; font-size: 12pt"); } +updTime=()=>{ +var date=new Date(); +var min=60-date.getMinutes(); +var sec=60-date.getSeconds(); +this.setState({time: min+"M:"+sec+"S",newYear:date.getYear()==2022}); +} componentDidMount(){ this.printConsoleData(); + + } +componentDidMount() { + this.interval = setInterval(updTime, 1000); +} +componentWillUnmount() { + clearInterval(this.interval); +} render() { const{theme}=this.state; return (
-
-
+ { + this.state.newyear?"Happy New Year 2022": this.state.time +} + {/*
+
- {/*
+ {/*
*/} {/* */} @@ -50,6 +69,7 @@ class App extends React.Component {
+ */}
) } From a190cd083ff0c4ca4f87e4b0237d22a5356e9d15 Mon Sep 17 00:00:00 2001 From: CHILUKURI SRI HARSHA Date: Fri, 31 Dec 2021 23:42:29 +0530 Subject: [PATCH 2/5] Update App.js --- src/App.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/App.js b/src/App.js index 6ef47ef..ad6a82c 100644 --- a/src/App.js +++ b/src/App.js @@ -56,20 +56,7 @@ componentWillUnmount() { { this.state.newyear?"Happy New Year 2022": this.state.time } - {/*
-
-
-
- {/*
- -
*/} - {/* */} -
-
- -
- - */} +
) } From f46644310f3ef493d840d576f59f03d5188dfd00 Mon Sep 17 00:00:00 2001 From: CHILUKURI SRI HARSHA Date: Fri, 31 Dec 2021 23:47:19 +0530 Subject: [PATCH 3/5] Update App.js --- src/App.js | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/src/App.js b/src/App.js index ad6a82c..15d8d6e 100644 --- a/src/App.js +++ b/src/App.js @@ -1,56 +1,32 @@ import React from "react"; import "./App.css"; -// import Projects from "./components/Projects/Projects"; -import Jobs from "./components/Jobs/Jobs"; -import Header from "./components/Header/Header"; -import Contact from "./components/Contact/Contact"; -// import Resume from "./components/CV/Resume"; -import GithubStats from "./components/Github/GithubStats"; -import ThemeSwitch from "./components/ThemeSwitch/ThemeSwitch"; + class App extends React.Component { constructor(props) { super(props) this.state = { - theme:"dark", NewYear:false, time:"00h:00m:00s" } } - onChangeTheme=()=>{ - const {theme}=this.state; - if(theme==="dark"){ - this.setState({theme:"light"}); - } - else{ - this.setState({theme:"dark"}); - } - } - printConsoleData=()=>{ - console.log("%cHi There\nI am Chilukuri Sri Harsha", "color:blue; font-size: 16pt"); - console.log("%cYou are here probably because you know some code\nWant to discuss anything with me? Contact me at sharshach@gmail.com", "color:green; font-size: 12pt"); - - } + + updTime=()=>{ var date=new Date(); var min=60-date.getMinutes(); var sec=60-date.getSeconds(); -this.setState({time: min+"M:"+sec+"S",newYear:date.getYear()==2022}); +this.setState({time: min+"M:"+sec+"S",newYear:date.getYear()===2022}); } - componentDidMount(){ - this.printConsoleData(); - - - } + componentDidMount() { - this.interval = setInterval(updTime, 1000); + this.interval = setInterval(this.updTime, 1000); } componentWillUnmount() { clearInterval(this.interval); } render() { - const{theme}=this.state; return (
{ From c109419de15597109325375415f367eb069cdfe4 Mon Sep 17 00:00:00 2001 From: CHILUKURI SRI HARSHA Date: Fri, 31 Dec 2021 23:52:31 +0530 Subject: [PATCH 4/5] Update App.js --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 15d8d6e..2655ec8 100644 --- a/src/App.js +++ b/src/App.js @@ -15,7 +15,7 @@ time:"00h:00m:00s" updTime=()=>{ var date=new Date(); -var min=60-date.getMinutes(); +var min=60-date.getMinutes()-1; var sec=60-date.getSeconds(); this.setState({time: min+"M:"+sec+"S",newYear:date.getYear()===2022}); } From 6192663d143e4cf9d99b3c5d8414e74cc36dd38e Mon Sep 17 00:00:00 2001 From: CHILUKURI SRI HARSHA Date: Sat, 1 Jan 2022 00:01:14 +0530 Subject: [PATCH 5/5] Update App.js --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 2655ec8..7bba194 100644 --- a/src/App.js +++ b/src/App.js @@ -30,7 +30,7 @@ componentWillUnmount() { return (
{ - this.state.newyear?"Happy New Year 2022": this.state.time + "Happy New Year 2022" }