feat: [FC-0070] Remove backend redirects (use SPA functionality) (#1372)
Introduces the ability to utilize SPA functionality when the relevant waffle flags are enabled for current MFE pages. When any new MFE page is loaded, a request is made to retrieve the waffle flags. This includes both global waffle flags related to MFE Authoring pages, as well as waffle flags specific to the current course.
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Hyperlink } from '@openedx/paragon';
|
||||
|
||||
const HelpSidebarLink = ({ as, pathToPage, title }) => {
|
||||
const HelpSidebarLink = ({
|
||||
as, pathToPage, title, isNewPage,
|
||||
}) => {
|
||||
const TagElement = as;
|
||||
if (isNewPage) {
|
||||
return (
|
||||
<TagElement className="sidebar-link">
|
||||
<Link to={pathToPage}>
|
||||
{title}
|
||||
</Link>
|
||||
</TagElement>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<TagElement className="sidebar-link">
|
||||
<Hyperlink
|
||||
@@ -18,6 +30,7 @@ const HelpSidebarLink = ({ as, pathToPage, title }) => {
|
||||
};
|
||||
|
||||
HelpSidebarLink.propTypes = {
|
||||
isNewPage: PropTypes.bool,
|
||||
pathToPage: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
as: PropTypes.string,
|
||||
@@ -25,6 +38,7 @@ HelpSidebarLink.propTypes = {
|
||||
|
||||
HelpSidebarLink.defaultProps = {
|
||||
as: 'li',
|
||||
isNewPage: true,
|
||||
};
|
||||
|
||||
export default HelpSidebarLink;
|
||||
|
||||
Reference in New Issue
Block a user