From 38fad29247acb4c3b0e6913cc9d99c1b49e962cd Mon Sep 17 00:00:00 2001 From: IzaacAyelin Date: Mon, 13 Feb 2023 19:05:34 +0200 Subject: [PATCH] fix isRelevant --- .../options/layoutParams_targetItemSize_value.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/lib/src/settings/options/layoutParams_targetItemSize_value.js b/packages/lib/src/settings/options/layoutParams_targetItemSize_value.js index 1ae73096a6..0153ece17b 100644 --- a/packages/lib/src/settings/options/layoutParams_targetItemSize_value.js +++ b/packages/lib/src/settings/options/layoutParams_targetItemSize_value.js @@ -1,10 +1,16 @@ +import { default as GALLERY_CONSTS } from '../../common/constants'; +import optionsMap from '../../core/helpers/optionsMap'; + export default { title: 'Item Size (smart)', description: `Set the item size between 1 to 100 units. The real size will be determined by the layout.`, - isRelevant: () => { - return true; + isRelevant: (options) => { + return ( + options[optionsMap.layoutParams.structure.scrollDirection] === + GALLERY_CONSTS[optionsMap.layoutParams.structure.scrollDirection].VERTICAL + ); }, isRelevantDescription: - 'Set a Horizontal gallery ("Scroll Direction" as "Horizontal") and set Responsive Type to Fit to screen', + 'Set a VERTICAL gallery ("Scroll Direction" as "Vertical") and set Responsive Type to Fit to screen', default: 30, };