diff --git a/src/components/Profile.js b/src/components/Profile.js new file mode 100644 index 0000000..02eee29 --- /dev/null +++ b/src/components/Profile.js @@ -0,0 +1,122 @@ +import React, { useState, useEffect } from "react"; + +function Profile() { + const [person, setPerson] = useState({}); + let profname = "mohammed786"; + useEffect(() => { + fetch("https://api.github.com/users/" + profname) + .then((res) => res.json()) + .then((temp) => { + setPerson(temp); + }); + }, []); + return ( +
+
+

+ avatar +
+ {profname} +
+ {person.name}  + + + +
+
+

+
+
+
+ +
+
+ {person.id} +
+
Identity
+
+
+
+ +
+
+ {person.company} +
+
Company
+
+
+
+ +
+ +
Portfolio
+
+
+
+ +
+
+ {person.location} +
+
Location
+
+
+
+ +
+
+ {person.public_repos} +
+
Public repositories
+
+
+
+ +
+
+ {person.followers} +
+
Followers
+
+
+
+ +
+
+ {person.following} +
+
Following
+
+
+
+ +
+
+ {person.updated_at} +
+
Last modified on
+
+
+
+ +
+
+ {person.created_at} +
+
Account created on
+
+
+
+
+
+ ); +} + +export default Profile; diff --git a/src/containers/App/index.tsx b/src/containers/App/index.tsx index 94809ca..12e9e1e 100644 --- a/src/containers/App/index.tsx +++ b/src/containers/App/index.tsx @@ -10,7 +10,6 @@ interface AppState {} class App extends React.Component { render() { - return ( { { name: "Event", link: "/event" }, { name: "Talk", link: "/talk" }, { name: "Hackathon", link: "/hackathon" }, - { name: "Open Source", link: "/opensource" } + { name: "Open Source", link: "/opensource" }, + { name: "Profile", link: "/profile" }, ]} /> diff --git a/src/routes/index.tsx b/src/routes/index.tsx index ad83307..34ec5fb 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -3,6 +3,7 @@ import { Redirect, Route, Switch } from "react-router-dom"; import PrivateRoute from "./PrivateRoute"; import Login from "../containers/Login"; import Logout from "../containers/Logout"; +import Profile from "../components/Profile"; const Event = React.lazy(() => import("../containers/Event")); const Hackathon = React.lazy(() => import("../containers/Hackathon")); @@ -56,6 +57,11 @@ class Routes extends React.Component { + + + + +