diff --git a/src/components/Dashboard/index.tsx b/src/components/Dashboard/index.tsx index 83c8d509..819c4504 100644 --- a/src/components/Dashboard/index.tsx +++ b/src/components/Dashboard/index.tsx @@ -27,11 +27,16 @@ import { TextContent } from '@patternfly/react-core/dist/esm/components/Text/Tex import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon'; import { Popover } from '@patternfly/react-core/dist/esm/components/Popover'; import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon'; +import { Modal, ModalVariant } from '@patternfly/react-core/dist/esm/components/Modal/Modal'; +import { useState } from 'react'; +import { Spinner } from '@patternfly/react-core/dist/esm/components/Spinner'; const Index: React.FunctionComponent = () => { const { data: session } = useSession(); const [pullRequests, setPullRequests] = React.useState([]); - const [error, setError] = React.useState(null); + const [isFirstPullDone, setIsFirstPullDone] = React.useState(false); + const [isLoading, setIsLoading] = useState(true); + //const [error, setError] = React.useState(null); const router = useRouter(); const fetchAndSetPullRequests = React.useCallback(async () => { @@ -52,8 +57,10 @@ const Index: React.FunctionComponent = () => { setPullRequests(sortedPRs); } catch (error) { - setError('Failed to fetch pull requests.'); + console.log('Failed to fetch pull requests.' + error); } + setIsFirstPullDone(true); + setIsLoading(false); } }, [session?.accessToken]); @@ -74,6 +81,10 @@ const Index: React.FunctionComponent = () => { } }; + const handleOnClose = () => { + setIsLoading(false); + }; + if (!session) { return
Loading...
; } @@ -109,8 +120,15 @@ const Index: React.FunctionComponent = () => {
- {error &&
{error}
} - {pullRequests.length === 0 ? ( + {!isFirstPullDone && ( + handleOnClose()}> +
+ + Retrieving all your skills and knowledge submissions from taxonomy repository. +
+
+ )} + {isFirstPullDone && pullRequests.length === 0 ? (