-
-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: quote generator, prettier ran. (#685)
- Loading branch information
1 parent
9670773
commit d06fc88
Showing
1 changed file
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { useState } from 'react'; | ||
import { block } from 'million/react'; | ||
|
||
const QuoteGenerator: React.FC = block(() => { | ||
const [quote, setQuote] = useState<string>(''); | ||
|
||
const fetchNewQuote = () => { | ||
fetch('https://api.quotable.io/random') | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
if (data.content) { | ||
setQuote(data.content); | ||
} | ||
}) | ||
.catch((error) => console.error('Error fetching quotes:', error)); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h1>Inspirational Quote Generator</h1> | ||
<button onClick={fetchNewQuote}>Get New Quote</button> | ||
<p>{quote}</p> | ||
</div> | ||
); | ||
}); | ||
|
||
export default QuoteGenerator; |
d06fc88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
million-kitchen-sink – ./packages/kitchen-sink
million-kitchen-sink-git-main-millionjs.vercel.app
million-kitchen-sink.vercel.app
million-kitchen-sink-millionjs.vercel.app
d06fc88
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sink – ./packages/kitchen-sink
sink-git-main-millionjs.vercel.app
sink-millionjs.vercel.app
million-kitchen-sink-atit.vercel.app
sink.million.dev