Skip to content

Commit

Permalink
Removes instances where we've feature flagged the new (current) design (
Browse files Browse the repository at this point in the history
  • Loading branch information
jkachel authored Jan 19, 2024
1 parent d6de83b commit e59c750
Show file tree
Hide file tree
Showing 17 changed files with 335 additions and 959 deletions.
560 changes: 189 additions & 371 deletions cms/templates/product_page.html

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions frontend/public/src/components/AnonymousMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import React from "react"

import MixedLink from "./MixedLink"
import { routes } from "../lib/urls"
import { checkFeatureFlag } from "../lib/util"

type Props = {
mobileView: boolean
}

const AnonymousMenu = ({ mobileView }: Props) => {
const identifierPostfix = mobileView ? "Mobile" : "Desktop"
const newDesign = checkFeatureFlag("mitxonline-new-header", "anonymousUser")
const makeNavLink = (text: string) => {
return mobileView ? (
<span data-bs-target="#nav" data-bs-toggle="collapse">
Expand All @@ -24,18 +22,16 @@ const AnonymousMenu = ({ mobileView }: Props) => {
}
return (
<ul>
{newDesign ? (
<li>
<MixedLink
id="catalog"
dest={routes.catalog}
className="top-nav-link"
aria-label="Catalog"
>
{makeNavLink("Catalog")}
</MixedLink>
</li>
) : null}
<li>
<MixedLink
id="catalog"
dest={routes.catalog}
className="top-nav-link"
aria-label="Catalog"
>
{makeNavLink("Catalog")}
</MixedLink>
</li>
<li>
<MixedLink
id={"login".concat(identifierPostfix)}
Expand Down
6 changes: 3 additions & 3 deletions frontend/public/src/components/AnonymousMenu_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("AnonymousMenu component", () => {
assert.equal(
shallow(<AnonymousMenu mobileView={false} />)
.find("MixedLink")
.at(0)
.at(1)
.prop("dest"),
routes.login
)
Expand All @@ -21,7 +21,7 @@ describe("AnonymousMenu component", () => {
assert.equal(
shallow(<AnonymousMenu mobileView={false} />)
.find("MixedLink")
.at(1)
.at(2)
.prop("dest"),
routes.register.begin
)
Expand All @@ -31,7 +31,7 @@ describe("AnonymousMenu component", () => {
assert.equal(
shallow(<AnonymousMenu mobileView={true} />)
.find("MixedLink")
.at(1)
.at(2)
.prop("dest"),
routes.register.begin
)
Expand Down
Loading

0 comments on commit e59c750

Please sign in to comment.