Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Q4 Reactjs #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { useState } from "react";
import "./App.css";
import GitHubLogin from "./GithubLogin";

function App() {
const [name, setName] = useState("Samsul Arifin");

return (
<div className="App">
<header className="App-header">
{name && <h2>Hai {name}</h2>}
<GitHubLogin
clientId=""
redirectUri=""
onSuccess={(name) => setName(name)}
onFailure={(resp) => console.log(resp)}
/>
</header>
</div>
);
}

export default App;
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./App.css";
import GitHubLogin from "./GithubLogin";

function App() {
const [name, setName] = useState("");
const [name, setName] = useState("Samsul Arifin");

return (
<div className="App">
Expand Down