From 777e6d09851ce816b676d2a4e0b957b9e30e63ba Mon Sep 17 00:00:00 2001 From: pKallert <91674611+pKallert@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:40:29 +0100 Subject: [PATCH] Feature: update styling --- .../DimensionSwitcher/DimensionSelectorOption.js | 2 +- .../PrimaryToolbar/DimensionSwitcher/index.js | 13 +++++++------ .../selectBox_Option_SingleLine.js | 4 ++-- .../SelectBox_Option_SingleLine/style.module.css | 4 +++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/DimensionSelectorOption.js b/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/DimensionSelectorOption.js index f2dd637334..ef617ee75b 100644 --- a/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/DimensionSelectorOption.js +++ b/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/DimensionSelectorOption.js @@ -11,7 +11,7 @@ export default class DimensionSelectorOption extends PureComponent { label: PropTypes.string.isRequired, disallowed: PropTypes.bool, existing: PropTypes.bool, - url: PropTypes.bool + url: PropTypes.string }) }; diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js b/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js index 9656800625..055ead8e64 100644 --- a/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js +++ b/packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js @@ -286,10 +286,10 @@ export default class DimensionSwitcher extends PureComponent { const variants = [...currentDocumentNode?.otherNodeVariants]; variants.push(currentDocumentNode.dimensions) - console.log(variants); - for(let dimensionKey of Object.keys(contentDimensions)){ - if(dimensionKey == dimensionName && contentDimensions.length !== 1) { - break; + + for (const dimensionKey of Object.keys(contentDimensions)) { + if (dimensionKey === dimensionName || Object.keys(contentDimensions).length === 1) { + break; } Object.entries(variants).forEach(entry => { const [key, value] = entry; @@ -298,12 +298,13 @@ export default class DimensionSwitcher extends PureComponent { delete variants[key] } }); + } const dimensions = [] Object.values(variants).forEach(entry => { dimensions.push(entry[dimensionName]); }); - + return dimensions; } @@ -317,7 +318,7 @@ export default class DimensionSwitcher extends PureComponent { label: i18nRegistry.translate(presetConfiguration.label), disallowed: !(allowedPresets[dimensionName] && allowedPresets[dimensionName].includes(presetName)), existing: documentDimensions.some(dimension=> presetConfiguration.values.includes(dimension)), - url: (Object.keys(contentDimensionsObject).length === 1) ? this.createDirectDimensionsLink( dimensionName, presetName) : null + url: (Object.keys(contentDimensions).length === 1) ? this.createDirectDimensionsLink( dimensionName, presetName) : null }); }); } diff --git a/packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js b/packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js index 23ffb158e4..0526a9dc55 100644 --- a/packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js +++ b/packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js @@ -32,8 +32,8 @@ class SelectBox_Option_SingleLine extends PureComponent { const isDisabled = disabled || option.disabled; const finalClassNames = mergeClassNames({ - [className]: className - [style.linkedItem]: true + [className]: className, + [style.linkedItem]: linkOptions }); const previewElementIcon = option.icon ? option.icon : (icon ? icon : null); diff --git a/packages/react-ui-components/src/SelectBox_Option_SingleLine/style.module.css b/packages/react-ui-components/src/SelectBox_Option_SingleLine/style.module.css index 99d244ec21..700add1428 100644 --- a/packages/react-ui-components/src/SelectBox_Option_SingleLine/style.module.css +++ b/packages/react-ui-components/src/SelectBox_Option_SingleLine/style.module.css @@ -1,6 +1,8 @@ .dropdownLink{ color: white; + padding: 5px 14px; + display: inline-block; } .linkedItem{ - background-color: red; + padding: 0px !important; }