diff --git a/FrontEnd/Sailfish-JS-report/src/components/ExpandablePanel.tsx b/FrontEnd/Sailfish-JS-report/src/components/ExpandablePanel.tsx index 6b084e02..326d83bd 100644 --- a/FrontEnd/Sailfish-JS-report/src/components/ExpandablePanel.tsx +++ b/FrontEnd/Sailfish-JS-report/src/components/ExpandablePanel.tsx @@ -15,7 +15,7 @@ ******************************************************************************/ import { h, Component } from "preact"; -import "../styles/panel.scss" +import "../styles/expandablePanel.scss" import { createSelector } from '../helpers/styleCreators'; interface PanelProps { @@ -51,23 +51,23 @@ export default class ExpandablePanel extends Component { render({ header, body, children, expandedHeader }: PanelProps, { isExpanded }: PanelState) { const iconClass = createSelector( - "expandable-panel-header-icon", + "expandable-panel__icon", isExpanded ? "expanded" : "hidden" ); return ( -
-
+
+
this.expandPanel()}/> - {(expandedHeader && isExpanded) || header || children[0]} + { (expandedHeader && isExpanded) || header || children[0] }
- {isExpanded ? -
- {body || children.slice(1)} -
- : null} + { + isExpanded ? + body || children.slice(1) + : null + }
) } -} \ No newline at end of file +} diff --git a/FrontEnd/Sailfish-JS-report/src/styles/panel.scss b/FrontEnd/Sailfish-JS-report/src/styles/expandablePanel.scss similarity index 77% rename from FrontEnd/Sailfish-JS-report/src/styles/panel.scss rename to FrontEnd/Sailfish-JS-report/src/styles/expandablePanel.scss index 72bd4619..5e4eb839 100644 --- a/FrontEnd/Sailfish-JS-report/src/styles/panel.scss +++ b/FrontEnd/Sailfish-JS-report/src/styles/expandablePanel.scss @@ -14,22 +14,22 @@ * limitations under the License. ******************************************************************************/ -.expandable-panel-root { +.expandable-panel { display: block; box-sizing: border-box; width: 100%; height: auto; padding-left: 10px; -} -.expandable-panel-header { - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - min-height: 40px; + &__header { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + min-height: 40px; + } - .expandable-panel-header-icon { + &__icon { height: 15px; width: 15px; cursor: pointer; @@ -45,12 +45,3 @@ } } } - -.expandable-panel-body { - display: block; -} - -.expandable-panel-body-hidden { - @extend .expandable-panel-body; - display: none; -} \ No newline at end of file