-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
222e82a
commit a4344b2
Showing
23 changed files
with
350 additions
and
325 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
import React from 'react'; | ||
|
||
import Button from './button'; | ||
import Fade from './fade'; | ||
import Link from './link'; | ||
|
||
function About({ onHide, show }) { | ||
return ( | ||
<Fade className="about" show={show}> | ||
<div className="about-content"> | ||
<h2>About</h2> | ||
<p> | ||
<Link link="GITHUB_REPO">Google Globe Trends</Link> is a{' '} | ||
<Link link="JAMSTACK">JAMstack</Link> application built without any | ||
server components. Data is fetched during build time using the{' '} | ||
<Link link="GOOGLE_TRENDS_API">google-trends-api</Link> library. Globe | ||
visualizations are rendered using the{' '} | ||
<Link link="REACT_GLOBE_GITHUB">react-globe</Link> component. | ||
</p> | ||
<p> | ||
This project is inspired by the wonderful{' '} | ||
<Link link="METOO">#metoorising</Link> project. With most of | ||
interactive features supported by{' '} | ||
<Link link="REACT_GLOBE_GITHUB">react-globe</Link>, the project aims | ||
to simplify building beautiful globe visualizations with Google Trends | ||
datasets. | ||
</p> | ||
<p> | ||
To deploy your own Google Globe Trends instances, click on the | ||
<b>Deploy to Netlify</b> button below. You can edit and commit the{' '} | ||
<Link link="CONFIG">config.js</Link> file to customize data and globe | ||
options. Please visit the <Link link="GITHUB_REPO">Github</Link>{' '} | ||
project page for more instructions on customizing instances. | ||
</p> | ||
<p> | ||
<Link link="NETLIFY_DEPLOY"> | ||
<img | ||
src="https://www.netlify.com/img/deploy/button.svg" | ||
alt="Deploy to Netlify" | ||
/> | ||
</Link> | ||
</p> | ||
<Button label="Back" onClick={onHide} /> | ||
</div> | ||
</Fade> | ||
); | ||
} | ||
|
||
export default About; |
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
File renamed without changes.
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 @@ | ||
import React from 'react'; | ||
|
||
import { useStateValue } from '../state'; | ||
import Link from './link'; | ||
|
||
export default function Description() { | ||
const [{ config }] = useStateValue(); | ||
|
||
return ( | ||
<> | ||
Visualizing <b>{`"${config.keyword.join(', ')}"`}</b> Google Trends with{' '} | ||
<Link link="REACT_GLOBE_GITHUB">react-globe</Link> | ||
</> | ||
); | ||
} |
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,34 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
export default function Fade({ children, className, durationMs, show }) { | ||
const [shouldRender, setShouldRender] = useState(show); | ||
|
||
useEffect(() => { | ||
if (show) { | ||
setShouldRender(true); | ||
} | ||
}, [show]); | ||
|
||
const onAnimationEnd = () => { | ||
if (!show) { | ||
setShouldRender(false); | ||
} | ||
}; | ||
|
||
if (!shouldRender) { | ||
return null; | ||
} | ||
|
||
const animation = `${ | ||
show ? 'fade-in' : 'fade-out' | ||
} ${durationMs}ms ease-in-out`; | ||
|
||
return ( | ||
<div | ||
className={className} | ||
style={{ animation }} | ||
onAnimationEnd={onAnimationEnd}> | ||
{children} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.