Skip to content

Commit 22d3a9e

Browse files
arbrandesclaude
andcommitted
fix: fix the header
Use a roles array in the dashboard route so that header slot widgets scope correctly to the dashboard role, and set the Courses link URL accordingly. Also wrap MasqueradeBar in a Paragon Container so its content aligns with the header and main content areas. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4a75852 commit 22d3a9e

5 files changed

Lines changed: 51 additions & 18 deletions

File tree

package-lock.json

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

src/routes.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { authenticatedLoader } from '@openedx/frontend-base';
1+
import { authenticatedLoader, homeRole } from '@openedx/frontend-base';
22
import { dashboardRole } from './constants';
33

44
const routes = [
@@ -7,7 +7,7 @@ const routes = [
77
path: '/learner-dashboard',
88
loader: authenticatedLoader,
99
handle: {
10-
role: dashboardRole
10+
roles: [dashboardRole, homeRole]
1111
},
1212
async lazy () {
1313
const module = await import('./Main');

src/widgets/LearnerDashboardHeader/MasqueradeBar/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { SiteContext } from '@openedx/frontend-base';
33

44
import {
55
Chip,
6+
Container,
67
Form,
78
FormControl,
89
FormControlFeedback,
@@ -36,8 +37,9 @@ export const MasqueradeBar = () => {
3637
if (!canMasquerade) { return null; }
3738

3839
return (
39-
<div className="w-100 shadow-sm px-2">
40-
<Form className="masquerade-bar w-100">
40+
<div className="w-100 shadow-sm">
41+
<Container fluid size="xl">
42+
<Form className="masquerade-bar w-100">
4143
{isMasquerading ? (
4244
<>
4345
<FormLabel inline="true" className="masquerade-form-label">
@@ -85,6 +87,7 @@ export const MasqueradeBar = () => {
8587
</>
8688
)}
8789
</Form>
90+
</Container>
8891
</div>
8992
);
9093
};

src/widgets/LearnerDashboardHeader/MasqueradeBar/index.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.masquerade-bar {
22
display: flex;
33
align-items: flex-start;
4-
padding: var(--pgn-spacing-spacer-3);
4+
padding: var(--pgn-spacing-spacer-3) 0;
55
margin-bottom: var(--pgn-spacing-spacer-2);
66

77
.masquerade-form-label {
8-
padding: var(--pgn-spacing-spacer-2) var(--pgn-spacing-spacer-3);
8+
padding: var(--pgn-spacing-spacer-2) var(--pgn-spacing-spacer-3) var(--pgn-spacing-spacer-2) 0;
99
display: flex;
1010
align-items: center;
1111
margin-bottom: 0;
@@ -31,6 +31,6 @@
3131
@media (--pgn-size-breakpoint-max-width-md) {
3232
.masquerade-bar {
3333
margin: auto;
34-
padding: var(--pgn-spacing-spacer-3) var(--pgn-spacing-spacer-4);
34+
padding: var(--pgn-spacing-spacer-3) 0;
3535
}
3636
}

src/widgets/LearnerDashboardHeader/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const app: App = {
2929
element: (
3030
<LinkMenuItem
3131
label={<CoursesLink />}
32-
url="/"
32+
role={dashboardRole}
3333
variant="navLink"
3434
/>
3535
),

0 commit comments

Comments
 (0)