File tree 2 files changed +16
-11
lines changed
src/components/pages/overview-page
2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,7 @@ export const OverviewPage = (props: OverviewPageProps) => {
70
70
{ filteredList . map ( ( product ) => (
71
71
< li key = { `${ product . anchorId } -${ language } ` } >
72
72
{ isAllProductsOverview ? (
73
- < OverviewLinkPanel
74
- product = { product . productLinks [ 0 ] }
75
- illustration = { product . illustration }
76
- />
73
+ < OverviewLinkPanel product = { product } />
77
74
) : (
78
75
< OverviewProductDetailsPanel
79
76
productDetails = { product }
Original file line number Diff line number Diff line change 1
1
import { MiniCard } from 'components/_common/card/MiniCard' ;
2
2
import { CardType } from 'types/card' ;
3
3
import { LinkProps } from 'types/link-props' ;
4
- import { AnimatedIconsProps } from 'types/content-props/animated-icons ' ;
5
- import { OverviewPageProductLink } from 'types/content-props/overview-props ' ;
4
+ import { OverviewPageProductItem } from 'types/content-props/overview-props ' ;
5
+ import { logger } from 'srcCommon/logger ' ;
6
6
7
7
import style from './ProductLink.module.scss' ;
8
8
9
9
type Props = {
10
- product : OverviewPageProductLink ;
11
- illustration : AnimatedIconsProps ;
10
+ product : OverviewPageProductItem ;
12
11
} ;
13
12
14
- export const OverviewLinkPanel = ( { product, illustration } : Props ) => {
13
+ export const OverviewLinkPanel = ( { product } : Props ) => {
14
+ const { title, illustration, productLinks } = product ;
15
+
16
+ const productLink = productLinks [ 0 ] ;
17
+
18
+ if ( ! productLink ?. url ) {
19
+ logger . error ( `No url set for overview link panel ${ title } ` ) ;
20
+ return null ;
21
+ }
22
+
15
23
const link : LinkProps = {
16
- url : product . url ,
17
- text : product . title ,
24
+ url : productLink . url ,
25
+ text : title ,
18
26
} ;
19
27
20
28
return (
You can’t perform that action at this time.
0 commit comments