Skip to content

Commit

Permalink
fix: get cta buttons from the player
Browse files Browse the repository at this point in the history
  • Loading branch information
anoblet committed Feb 13, 2024
1 parent 6ad9f38 commit c517a76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/VideoLayout/VideoLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const VideoLayout: React.FC<Props> = ({
);
};

const customCTAs = useCustomCtaButtons(item);
const customCTAs = useCustomCtaButtons(player);

// Check and setup CTAs
const extraButtons: React.ReactNode[] = useMemo(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useCustomCtaButtons.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// React hook
import { useMemo } from 'react';

import type { PlaylistItem } from '#types/playlist';
import type { CTAItem } from '#components/CTAButton/CTAButton';

const useCustomCtaButtons = (itemData?: PlaylistItem) => {
const useCustomCtaButtons = (player: any) => {

Check warning on line 6 in src/hooks/useCustomCtaButtons.ts

View workflow job for this annotation

GitHub Actions / lint (18.x)

Unexpected any. Specify a different type
const itemData = player.props.seriesItem;

// Check and setup CTAs
const customItems = useMemo(() => {
const allowedKeys = ['cta_exam', 'cta_slides', 'cta_resource1', 'cta_resource2', 'cta_resource3'];
Expand Down

0 comments on commit c517a76

Please sign in to comment.