Skip to content

Commit

Permalink
fix: Revert prop name, change state name
Browse files Browse the repository at this point in the history
  • Loading branch information
mizlan committed Oct 25, 2023
1 parent f9025dd commit 04ac251
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/common/LoadingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import '../../styles/Loading.scss';
import { GH_REPO_NAME } from '../../constants';

interface LoadingProps {
shouldShowHelpText: boolean;
showHelpText: boolean;
}

const Loading = ({ shouldShowHelpText = false }: LoadingProps) => {
const [showHelpText, setShowHelpText] = useState(shouldShowHelpText);
const Loading = function ({ showHelpText = false } : LoadingProps) {
const [hasHelpText, setHasHelpText] = useState(showHelpText);

const timer = setTimeout(
() => {
setShowHelpText(true);
setHasHelpText(true);
},
2000,
);
Expand All @@ -25,7 +25,7 @@ const Loading = ({ shouldShowHelpText = false }: LoadingProps) => {
<div className="Loading">
<div className="Loading-title">Loading</div>
<RingLoader color="#171124" size={250} loading />
{showHelpText && (
{ hasHelpText && (
<p className="Loading-page-text" style={{ color: 'white' }}>
Looks like loading is taking a bit long! If it takes too long, submit an issue on
{' '}
Expand Down

0 comments on commit 04ac251

Please sign in to comment.