From e9d8b1811ecd18d5de932052bf75e70cf027dbd7 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 18 Jan 2018 16:29:18 +0200 Subject: [PATCH] NamedLink props in SectionThumbnailLinks should accept params prop --- .../SectionThumbnailLinks/SectionThumbnailLinks.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/SectionThumbnailLinks/SectionThumbnailLinks.js b/src/components/SectionThumbnailLinks/SectionThumbnailLinks.js index 65a2bbb0..d55d2efb 100644 --- a/src/components/SectionThumbnailLinks/SectionThumbnailLinks.js +++ b/src/components/SectionThumbnailLinks/SectionThumbnailLinks.js @@ -1,5 +1,5 @@ import React from 'react'; -import { string, arrayOf, shape, node, oneOf, oneOfType } from 'prop-types'; +import { string, arrayOf, shape, node, object, oneOf, oneOfType } from 'prop-types'; import classNames from 'classnames'; import { ExternalLink, NamedLink } from '../../components'; @@ -16,14 +16,14 @@ const ThumbnailLink = props => { linkProps, text, } = props; - const { type, name, to, href } = linkProps; + const { type, name, params, to, href } = linkProps; const classes = classNames(rootClassName || css.link, className, { [css.link2Columns]: linksPerRow === 2, [css.link3Columns]: linksPerRow === 3, }); const imageWrapperClasses = classNames(css.imageWrapper, imageWrapperClassName); - const LinkComponentProps = type === 'NamedLink' ? { name, to } : { href }; + const LinkComponentProps = type === 'NamedLink' ? { name, params, to } : { href }; const LinkComponent = type === 'NamedLink' ? NamedLink : ExternalLink; return ( @@ -88,6 +88,7 @@ SectionThumbnailLinks.defaultProps = { const namedLinkShape = shape({ type: oneOf(['NamedLink']).isRequired, name: string.isRequired, + params: object, to: shape({ search: string, hash: string,