diff --git a/src/hooks/useGetConfig.js b/src/hooks/useGetConfig.js
new file mode 100644
index 0000000000..b897ef0355
--- /dev/null
+++ b/src/hooks/useGetConfig.js
@@ -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;
diff --git a/src/index.jsx b/src/index.jsx
index 2a82c13e60..12dc75e4af 100755
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -12,6 +12,8 @@ import { Switch } from 'react-router-dom';
import { messages as footerMessages } from '@edx/frontend-component-footer';
import { messages as headerMessages } from '@edx/frontend-component-header';
+import { QueryClient, QueryClientProvider } from 'react-query';
+import REACT_QUERY_CONSTANTS from './constants/react-query-constants';
import { fetchDiscussionTab, fetchLiveTab } from './course-home/data/thunks';
import DiscussionTab from './course-home/discussion-tab/DiscussionTab';
@@ -38,67 +40,75 @@ import CourseAccessErrorPage from './generic/CourseAccessErrorPage';
import DecodePageRoute from './decode-page-route';
subscribe(APP_READY, () => {
+ const queryClient = new QueryClient({
+ defaultOptions: {
+ ...REACT_QUERY_CONSTANTS,
+ },
+ });
+
ReactDOM.render(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (
- fetchProgressTab(courseId, match.params.targetUserId)}
- slice="courseHome"
- >
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (
+ fetchProgressTab(courseId, match.params.targetUserId)}
+ slice="courseHome"
+ >
+
+
+ )}
+ />
+
+
+
- )}
- />
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
,
document.getElementById('root'),
);
diff --git a/src/tab-page/LoadedTabPage.jsx b/src/tab-page/LoadedTabPage.jsx
index 2ba3067d9e..f12126a27d 100644
--- a/src/tab-page/LoadedTabPage.jsx
+++ b/src/tab-page/LoadedTabPage.jsx
@@ -14,6 +14,7 @@ import useEnrollmentAlert from '../alerts/enrollment-alert';
import useLogistrationAlert from '../alerts/logistration-alert';
import ProductTours from '../product-tours/ProductTours';
+import useGetConfig from '../hooks/useGetConfig';
const LoadedTabPage = ({
activeTabSlug,
@@ -36,6 +37,10 @@ const LoadedTabPage = ({
const logistrationAlert = useLogistrationAlert(courseId);
const enrollmentAlert = useEnrollmentAlert(courseId);
+ const {
+ platformName,
+ } = useGetConfig();
+
const activeTab = tabs.filter(tab => tab.slug === activeTabSlug)[0];
const streakLengthToCelebrate = celebrations && celebrations.streakLengthToCelebrate;
@@ -51,7 +56,7 @@ const LoadedTabPage = ({
org={org}
/>
- {`${activeTab ? `${activeTab.title} | ` : ''}${title} | ${getConfig().SITE_NAME}`}
+ {`${activeTab ? `${activeTab.title} | ` : ''}${title} | ${platformName || getConfig().siteName}`}
{originalUserIsStaff && (