Skip to content

Commit c7d2b32

Browse files
authored
chore(plus/updates): hide filters if not authenticated (#13143)
* chore(plus/updates): hide filters if non-authenticated Also removes the upsell banner. * refactor(plus/updates): reuse canFilter
1 parent 7b30036 commit c7d2b32

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

client/src/plus/updates/index.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { useEffect, useState } from "react";
2121
import { useSearchParams } from "react-router-dom";
2222
import { DataError } from "../common";
2323
import { useCollections } from "../collections/api";
24-
import { PlusLoginBanner } from "../common/login-banner";
2524
import React from "react";
2625

2726
const LazyCompatTable = React.lazy(
@@ -191,26 +190,22 @@ function UpdatesLayout() {
191190
</Container>
192191
</header>
193192
<Container>
194-
<SearchFilter
195-
filters={filters}
196-
sorts={SORTS}
197-
isDisabled={!canFilter}
198-
onChange={(key, newValue, oldValue) =>
199-
gleanClick(
200-
`${PLUS_UPDATES.FILTER_CHANGE}_${key}: ${
201-
oldValue ?? "(default)"
202-
} -> ${newValue ?? "(default)"}`
203-
)
204-
}
205-
/>
206-
207-
{user && !user.isAuthenticated && (
208-
<PlusLoginBanner gleanPrefix={PLUS_UPDATES.MDN_PLUS}>
209-
Want to use filters?
210-
</PlusLoginBanner>
193+
{canFilter && (
194+
<SearchFilter
195+
filters={filters}
196+
sorts={SORTS}
197+
isDisabled={!canFilter}
198+
onChange={(key, newValue, oldValue) =>
199+
gleanClick(
200+
`${PLUS_UPDATES.FILTER_CHANGE}_${key}: ${
201+
oldValue ?? "(default)"
202+
} -> ${newValue ?? "(default)"}`
203+
)
204+
}
205+
/>
211206
)}
212207

213-
{user && user.isAuthenticated && hasFilters && (
208+
{canFilter && hasFilters && (
214209
<Button
215210
type="action"
216211
extraClasses="reset-filters"

0 commit comments

Comments
 (0)