-
-
- {Object.entries(data.suggestions)
- .sort((a, b) => Number(a[0]) - Number(b[0]))
- .map(([tier, suggestions]) => {
- const id = String(tier);
- return (
-
-
- setTierVisible(tier)}
- data-cy={`plus${tier}-radio`}
- />
-
- );
- })}
-
- {canSuggestNewUserFE({ user, suggestions: data.suggestions }) ? (
- // TODO: resetScroll={false} https://twitter.com/ryanflorence/status/1527775882797907969
-
- Suggest
-
- ) : null}
-
+
+
- {visibleSuggestions.map((u) => {
- invariant(tierVisible);
- return (
-
- );
- })}
- {visibleSuggestions.length === 0 ? (
-
- No suggestions yet
+
+
+ {Object.entries(data.suggestions)
+ .sort((a, b) => Number(a[0]) - Number(b[0]))
+ .map(([tier, suggestions]) => {
+ const id = String(tier);
+ return (
+
+
+ setTierVisible(tier)}
+ data-cy={`plus${tier}-radio`}
+ />
+
+ );
+ })}
- ) : null}
+ {canSuggestNewUserFE({ user, suggestions: data.suggestions }) ? (
+ // TODO: resetScroll={false} https://twitter.com/ryanflorence/status/1527775882797907969
+
+ Suggest
+
+ ) : null}
+
+
+ {visibleSuggestions.map((u) => {
+ invariant(tierVisible);
+ return (
+
+ );
+ })}
+ {visibleSuggestions.length === 0 ? (
+
+ No suggestions yet
+
+ ) : null}
+
@@ -243,7 +246,7 @@ function useSetSelectedTierForFirstSuggestEffect({
}, [data, tierVisible, setTierVisible]);
}
-function SuggestedForInfo() {
+function SuggestedForInfo({ hideText = false }: { hideText?: boolean }) {
const data = useLoaderData
();
const user = useUser();
@@ -253,6 +256,8 @@ function SuggestedForInfo() {
}
if (data.suggestedForTiers.length === 0) {
+ if (hideText) return null;
+
return (
You are not suggested yet this month.
@@ -262,11 +267,13 @@ function SuggestedForInfo() {
return (
-
- You are suggested to{" "}
- {data.suggestedForTiers.map((tier) => `+${tier}`).join(" and ")} this
- month.
-
+ {!hideText ? (
+
+ You are suggested to{" "}
+ {data.suggestedForTiers.map((tier) => `+${tier}`).join(" and ")} this
+ month.
+
+ ) : null}
{canDeleteSuggestionOfThemselves() ? (
{data.suggestedForTiers.map((tier) => (