forked from reactplay/react-play
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into like-feature
- Loading branch information
Showing
25 changed files
with
708 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import PlayHeader from "common/playlists/PlayHeader"; | ||
import "./devJokes.css"; | ||
import axios from "axios"; | ||
import { useEffect, useState } from "react"; | ||
import Spinner from "./Spinner"; | ||
function DevJokes(props) { | ||
const [joke, setjoke] = useState([]); | ||
const [spinner, setspinner] = useState(false); | ||
const fetch = () => { | ||
setspinner(true); | ||
axios | ||
.get("https://backend-omega-seven.vercel.app/api/getjoke") | ||
.then((response) => { | ||
setjoke(response.data); | ||
setspinner(false); | ||
}); | ||
}; | ||
useEffect(() => { | ||
fetch(); | ||
}, []); | ||
return ( | ||
<> | ||
<div className="play-details"> | ||
<PlayHeader play={props} /> | ||
<div className="maincontanier"> | ||
<div className="jokecontanier"> | ||
{spinner ? ( | ||
<Spinner /> | ||
) : ( | ||
<div> | ||
{joke.map((value) => { | ||
return ( | ||
<div key={value}> | ||
<h1>{value.question}</h1> | ||
<p>{value.punchline}</p> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
)} | ||
</div> | ||
<button onClick={fetch} className="dev-jokes-btn"> | ||
Next joke | ||
</button> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default DevJokes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Dev jokes | ||
|
||
Developer jokes is a app where a random developer joke pops up every time you open it or click next joke | ||
|
||
## Play Demographic | ||
|
||
- Language: js | ||
- Level: Intermediate | ||
|
||
## Creator Information | ||
|
||
- User: yung-coder | ||
- Gihub Link: https://github.com/yung-coder | ||
- Blog: | ||
- Video: |
Oops, something went wrong.