diff --git a/frontend/src/components/Wrapped/Specifics/Bar.js b/frontend/src/components/Wrapped/Specifics/Bar.js index 1f31ca4b..0f25ac7e 100644 --- a/frontend/src/components/Wrapped/Specifics/Bar.js +++ b/frontend/src/components/Wrapped/Specifics/Bar.js @@ -29,7 +29,7 @@ const dayNames = [ 'Saturday', ]; -const BarMonth = ({ data }) => { +const BarMonth = ({ data, downloadLoading }) => { const newData = data?.month_data?.months || []; // eslint-disable-next-line no-unused-vars @@ -45,15 +45,17 @@ const BarMonth = ({ data }) => { {displayContribs ? 'By Contribution Count' : 'By LOC Changed'}

-
- -
+ {!downloadLoading && ( +
+ +
+ )} {displayContribs ? ( { BarMonth.propTypes = { data: PropTypes.object.isRequired, + downloadLoading: PropTypes.bool.isRequired, }; -const BarDay = ({ data }) => { +const BarDay = ({ data, downloadLoading }) => { const newData = data?.day_data?.days || []; const [displayContribs, setDisplayContribs] = useState(true); @@ -98,15 +101,17 @@ const BarDay = ({ data }) => { {displayContribs ? 'By Contribution Count' : 'By LOC Changed'}

-
- -
+ {!downloadLoading && ( +
+ +
+ )} {displayContribs ? ( { BarDay.propTypes = { data: PropTypes.object.isRequired, + downloadLoading: PropTypes.bool.isRequired, }; export { BarMonth, BarDay }; diff --git a/frontend/src/components/Wrapped/Specifics/Pie.js b/frontend/src/components/Wrapped/Specifics/Pie.js index 153657eb..cd727abb 100644 --- a/frontend/src/components/Wrapped/Specifics/Pie.js +++ b/frontend/src/components/Wrapped/Specifics/Pie.js @@ -6,7 +6,7 @@ import PropTypes from 'prop-types'; import { PieChart } from '../Templates'; import { WrappedCard } from '../Organization'; -const PieLangs = ({ data }) => { +const PieLangs = ({ data, downloadLoading }) => { const [useLOCAdded, setUseLOCAdded] = React.useState(false); const metric = useLOCAdded ? 'added' : 'changed'; @@ -20,15 +20,17 @@ const PieLangs = ({ data }) => {

Most Used Languages

{useLOCAdded ? 'By LOC Added' : 'By LOC Changed'}

-
- -
+ {!downloadLoading && ( +
+ +
+ )} { PieLangs.propTypes = { data: PropTypes.object.isRequired, + downloadLoading: PropTypes.bool.isRequired, }; -const PieRepos = ({ data }) => { +const PieRepos = ({ data, downloadLoading }) => { const [useLOCAdded, setUseLOCAdded] = React.useState(false); const metric = useLOCAdded ? 'added' : 'changed'; @@ -59,15 +62,17 @@ const PieRepos = ({ data }) => {

Most Active Repositories

{useLOCAdded ? 'By LOC Added' : 'By LOC Changed'}

-
- -
+ {!downloadLoading && ( +
+ +
+ )} { PieRepos.propTypes = { data: PropTypes.object.isRequired, + downloadLoading: PropTypes.bool.isRequired, }; export { PieLangs, PieRepos }; diff --git a/frontend/src/pages/Wrapped/Wrapped.js b/frontend/src/pages/Wrapped/Wrapped.js index 961ef180..65478d92 100644 --- a/frontend/src/pages/Wrapped/Wrapped.js +++ b/frontend/src/pages/Wrapped/Wrapped.js @@ -97,9 +97,11 @@ const WrappedScreen = () => { >
- - - + {!downloadLoading && ( + + + + )}

{`${userId}'s`}

@@ -224,10 +226,10 @@ const WrappedScreen = () => {
- +
- +
@@ -262,18 +264,18 @@ const WrappedScreen = () => {
- +
- +
{downloadLoading && ( -
- Get your own at www.githubtrends.io/wrapped +
+ Create your own at www.githubtrends.io/wrapped
)}
@@ -286,7 +288,7 @@ const WrappedScreen = () => { setTimeout(() => { downloadImage(); setDownloadLoading(false); - }, 1000); + }, 10); }} > {downloadLoading ? (