richie-education 2.25.0-b2.dev117 → 2.25.0-b2.dev118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { defineMessages, FormattedMessage } from 'react-intl';
3
3
  import { useSelect } from 'downshift';
4
+ import classNames from 'classnames';
4
5
  import { location } from 'utils/indirection/window';
5
6
  import { UserHelper } from 'utils/UserHelper';
6
7
  import { UserMenuProps } from '.';
@@ -36,6 +37,21 @@ export const DesktopUserMenu: FC<UserMenuProps> = ({ user }) => {
36
37
  },
37
38
  });
38
39
 
40
+ const teacherDasbhoardUrl = user.urls.find((link) => {
41
+ return link.key === 'dashboard_teacher';
42
+ });
43
+ let menuLinkList;
44
+ if (teacherDasbhoardUrl) {
45
+ menuLinkList = [
46
+ teacherDasbhoardUrl,
47
+ ...user.urls.filter((link) => {
48
+ return link.key !== 'dashboard_teacher';
49
+ }),
50
+ ];
51
+ } else {
52
+ menuLinkList = user.urls;
53
+ }
54
+
39
55
  return (
40
56
  <div className="user-menu user-menu--desktop selector">
41
57
  <label {...getLabelProps()} className="offscreen">
@@ -52,8 +68,14 @@ export const DesktopUserMenu: FC<UserMenuProps> = ({ user }) => {
52
68
  className={`selector__list ${isOpen ? '' : 'selector__list--is-closed'}`}
53
69
  >
54
70
  {isOpen &&
55
- user.urls.map((link, index) => (
56
- <li key={link.key} {...getItemProps({ item: link, index })}>
71
+ menuLinkList.map((link, index) => (
72
+ <li
73
+ key={link.key}
74
+ {...getItemProps({ item: link, index })}
75
+ className={classNames({
76
+ 'selector__list__item--bordered': link.key === 'dashboard_teacher',
77
+ })}
78
+ >
57
79
  {typeof link.action === 'string' ? (
58
80
  <a
59
81
  className={`selector__list__link ${
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.25.0-b2.dev117",
3
+ "version": "2.25.0-b2.dev118",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {
@@ -57,6 +57,12 @@
57
57
  margin-left: calc(3rem - 12px);
58
58
  }
59
59
 
60
+ &__item {
61
+ &--bordered:not(:last-child) {
62
+ border-bottom: $onepixel solid r-theme-val(topbar, item-divider-border);
63
+ }
64
+ }
65
+
60
66
  &__link {
61
67
  @include button-reset-style();
62
68
  background: r-theme-val(selector, base-background);