Skip to content

Commit

Permalink
feat: show video section to learners with active subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Maham Akif authored and Maham Akif committed Aug 6, 2024
1 parent beeacc8 commit 25726ec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/components/search/SearchPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@ import React from 'react';
import { SearchData } from '@edx/frontend-enterprise-catalog-search';
import { useIntl } from '@edx/frontend-platform/i18n';

import {
useSubscriptions,
} from '../app/data';
import { LICENSE_STATUS } from '../enterprise-user-subsidy/data/constants';
import Search from './Search';
import { SEARCH_TRACKING_NAME } from './constants';
import { getSearchFacetFilters } from './utils';
import { features } from '../../config';

const SearchPage = () => {
const intl = useIntl();

const { data: { subscriptionLicense } } = useSubscriptions();
const hasActivatedAndCurrentSubscription = (
subscriptionLicense?.status === LICENSE_STATUS.ACTIVATED
&& subscriptionLicense?.subscriptionPlan?.isCurrent
);

return (
<SearchData searchFacetFilters={getSearchFacetFilters(intl)} trackingName={SEARCH_TRACKING_NAME}>
<SearchData
searchFacetFilters={getSearchFacetFilters(intl)}
trackingName={SEARCH_TRACKING_NAME}
enableVideos={features.FEATURE_ENABLE_VIDEO_CATALOG && hasActivatedAndCurrentSubscription}
>
<Search />
</SearchData>
);
Expand Down

0 comments on commit 25726ec

Please sign in to comment.