Skip to content

Commit

Permalink
Added Template 1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kavyan17 committed Dec 6, 2023
1 parent 880bfe1 commit 72719e4
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions ProFolio-Frontend/src/components/Template1/Visits.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { Component } from "react";

class Visits extends Component {
constructor(props) {
super(props);

this.state = {
count: 0,
DataisLoaded: false,
};
}

componentDidMount() {
fetch("https://jsonplaceholder.typicode.com/posts/1")
.then((res) => res.json())
.then((data) => {
this.setState({
count: data.id,
DataisLoaded: true,
});
});
}

render() {
const { DataisLoaded, count } = this.state;
if (!DataisLoaded)
return (
<div>
<h1>Please wait some time....</h1>
</div>
);

return (
<div className="count center">
<br />
<br />
<br />
<br />
<br />
<br />
<p style={{ fontSize: 20, margin: 0 }}>This page was viewed</p>
<p style={{ fontSize: 40, margin: 0 }}>{count}</p>
<p style={{ fontSize: 20, margin: 0 }}>Times</p>
</div>
);
}
}

export default Visits;

0 comments on commit 72719e4

Please sign in to comment.