mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Merge pull request #657 from sharetribe/thumbnaillinks-params-prop
NamedLink props in SectionThumbnailLinks should accept params prop
This commit is contained in:
commit
76a5f7af44
1 changed files with 4 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue