Skip to content

Commit 2b80376

Browse files
authored
Merge pull request #5 from open-craft/pooja/bb9677-mfe-theme-fixes
[BB-9677] MFE Styling fixes
2 parents 6b4e0ac + 3ad63e7 commit 2b80376

19 files changed

Lines changed: 1451 additions & 719 deletions

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ SITE_NAME=''
2020
USER_INFO_COOKIE_NAME=''
2121
APP_ID=''
2222
MFE_CONFIG_API_URL=''
23+
DASHBOARD_PAGE_SIZE=

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ SITE_NAME='edX'
2121
USER_INFO_COOKIE_NAME='edx-user-info'
2222
APP_ID=''
2323
MFE_CONFIG_API_URL=''
24+
DASHBOARD_PAGE_SIZE=

.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ SITE_NAME=localhost
1919
USER_INFO_COOKIE_NAME='edx-user-info'
2020
APP_ID=''
2121
MFE_CONFIG_API_URL=''
22+
DASHBOARD_PAGE_SIZE=

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@open-craft/frontend-app-learning-paths",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Frontend application template",
55
"repository": {
66
"type": "git",

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!doctype html>
22
<html lang="en-us">
33
<head>
4-
<title>Learning Paths <%= (process.env.SITE_NAME && process.env.SITE_NAME != 'null') ? '| ' + process.env.SITE_NAME : '' %></title>
4+
<title>Dashboard <%= (process.env.SITE_NAME && process.env.SITE_NAME != 'null') ? '| ' + process.env.SITE_NAME : '' %></title>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<link rel="shortcut icon" href="<%=htmlWebpackPlugin.options.FAVICON_URL%>" type="image/x-icon" />

src/assets/no_results.svg

Lines changed: 17 additions & 0 deletions
Loading

src/hooks/useScreenSize.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { useMediaQuery, breakpoints } from '@openedx/paragon';
2+
3+
export function useScreenSize() {
4+
const isExtraSmall = useMediaQuery({ maxWidth: breakpoints.extraSmall.maxWidth });
5+
const isSmall = useMediaQuery({ maxWidth: breakpoints.small.maxWidth });
6+
const isMedium = useMediaQuery({ maxWidth: breakpoints.medium.maxWidth });
7+
const isLarge = useMediaQuery({ maxWidth: breakpoints.large.maxWidth });
8+
const isExtraLarge = useMediaQuery({ minWidth: breakpoints.extraLarge.minWidth });
9+
10+
return {
11+
isExtraSmall,
12+
isSmall,
13+
isMedium,
14+
isLarge,
15+
isExtraLarge,
16+
};
17+
}

src/index.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import 'core-js/stable';
22
import 'regenerator-runtime/runtime';
33

44
import {
5-
APP_INIT_ERROR, APP_READY, subscribe, initialize,
5+
APP_INIT_ERROR, APP_READY, subscribe, initialize, mergeConfig,
66
} from '@edx/frontend-platform';
77
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
88
import ReactDOM from 'react-dom/client';
99
import { Routes, Route } from 'react-router-dom';
1010
import { QueryClientProvider } from '@tanstack/react-query';
1111
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
1212

13-
import Header from '@edx/frontend-component-header';
13+
import { LearningHeader as Header } from '@edx/frontend-component-header';
1414
import FooterSlot from '@openedx/frontend-slot-footer';
1515
import messages from './i18n';
1616
import queryClient from './queryClient';
@@ -56,4 +56,12 @@ subscribe(APP_INIT_ERROR, (error) => {
5656

5757
initialize({
5858
messages,
59+
requireAuthenticatedUser: true,
60+
handlers: {
61+
config: () => {
62+
mergeConfig({
63+
DASHBOARD_PAGE_SIZE: process.env.DASHBOARD_PAGE_SIZE || null,
64+
}, 'LearningPathsConfig');
65+
},
66+
},
5967
});

0 commit comments

Comments
 (0)