Skip to content

Commit

Permalink
Reinstate action highlights header & action count
Browse files Browse the repository at this point in the history
The header can be optionally disabled, and the
default count changed. These are used in embeds
through query parameters.
  • Loading branch information
tituomin committed Oct 31, 2023
1 parent ffec8c2 commit ff74915
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/actions/ActionHighlightsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@ function ActionCardList(props: ActionCardListProps) {

type ActionHighlightsListProps = {
plan: PlanContextFragment;
count?: number;
displayHeader?: boolean;
};

function ActionHighlightsList(props: ActionHighlightsListProps) {
const { plan } = props;

const { plan, count, displayHeader } = props;
const { t } = useTranslation();

const queryParams = {
plan: plan.identifier,
first: 6,
first: count ?? 6,
orderBy: '-updatedAt',
};

Expand All @@ -175,7 +176,14 @@ function ActionHighlightsList(props: ActionHighlightsListProps) {
return (
<p>{t('error-loading-actions', getActionTermContext(plan))}</p>
);
return <ActionCardList t={t} actions={data.planActions} plan={plan} />;
return (
<ActionCardList
t={t}
actions={data.planActions}
plan={plan}
displayHeader={displayHeader ?? true}
/>
);
}}
</Query>
);
Expand Down

0 comments on commit ff74915

Please sign in to comment.