forked from openedx/frontend-app-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: title siteName replaced with platformName
- Loading branch information
1 parent
8356505
commit 4e77bcc
Showing
11 changed files
with
181 additions
and
88 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
const REACT_QUERY_CONSTANTS = { | ||
queries: { | ||
// Set staleTime to 5 minutes | ||
staleTime: 5 * 60 * 1000, | ||
// Set cacheTime to 60 minutes | ||
cacheTime: 60 * 60 * 1000, | ||
// Set the retry count for queries here | ||
retry: 1, // Set the retry count for queries here | ||
}, | ||
mutations: { | ||
retry: 1, // Set the retry count for mutations here | ||
}, | ||
}; | ||
|
||
export default REACT_QUERY_CONSTANTS; |
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
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
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,39 @@ | ||
import { getConfig } from '@edx/frontend-platform'; | ||
import { useQuery } from 'react-query'; | ||
import faviconPlaceholder from '../assets/place-holders/favicon.svg'; | ||
|
||
const useGetConfig = () => { | ||
const fetchConfig = async ({ baseURL, instanceConfigAPIUrl }) => { | ||
const response = await fetch(`${baseURL}${instanceConfigAPIUrl}`); | ||
const result = await response.json(); | ||
return result; | ||
}; | ||
|
||
const { data, isLoading, isError } = useQuery( | ||
'headerLogo', | ||
() => fetchConfig({ | ||
baseURL: getConfig().LMS_BASE_URL, | ||
instanceConfigAPIUrl: getConfig().AC_INSTANCE_CONFIG_API_URL, | ||
}), | ||
{ | ||
enabled: | ||
!!getConfig().LMS_BASE_URL && !!getConfig().AC_INSTANCE_CONFIG_API_URL, | ||
}, | ||
); | ||
const faviconVersion = Date.now(); // Update this version number when the favicon updates | ||
const favicon = data?.favicon | ||
? `${data.favicon}?v=${faviconVersion}` | ||
: faviconPlaceholder; | ||
return { | ||
headerLogo: data?.logo, | ||
hasBilling: data?.has_billing, | ||
favicon, | ||
platformName: data?.platform_name, | ||
gtm: data?.gtm, | ||
isTPAOnly: data?.use_tpa_only, | ||
TPAQueryparam: data?.tpa_queryparam, | ||
loading: isLoading, | ||
isError, | ||
}; | ||
}; | ||
export default useGetConfig; |
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
Oops, something went wrong.