File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
packages/module/src/ConsoleShared/src/components/markdown-extensions Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,12 @@ const useAccordionShowdownExtension = () => {
1717 regex : / \[ ( .+ ) ] { { ( a c c o r d i o n ) ( " ( .* ?) " ) } } / g,
1818 replace : (
1919 _text : string ,
20- _accordionContent : string ,
20+ accordionContent : string ,
2121 _command : string ,
2222 accordionHeading : string ,
2323 ) : string => {
24- const accordionId = new String ( accordionHeading ) . replace ( / \s / g, "-" ) ;
25- console . log ( accordionId ) ;
26- console . log ( accordionHeading ) ;
24+ const accordionId = new String ( accordionHeading ) . replace ( / \s / g, '-' ) ;
25+
2726 return removeTemplateWhitespace (
2827 renderToStaticMarkup (
2928 < Accordion asDefinitionList >
@@ -38,10 +37,7 @@ const useAccordionShowdownExtension = () => {
3837 id = { `${ ACCORDION_MARKDOWN_CONTENT_ID } -${ accordionId } ` }
3938 isHidden = { ! false }
4039 >
41- < p >
42- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
43- incididunt ut labore et dolore magna aliqua.
44- </ p >
40+ { accordionContent }
4541 </ AccordionContent >
4642 </ AccordionItem >
4743 </ Accordion > ,
Original file line number Diff line number Diff line change 1- /* eslint-disable react-hooks/rules-of-hooks */
2- import { stringify } from 'querystring' ;
31import * as React from 'react' ;
42import { useEventListener } from '../../hooks' ;
53import { ACCORDION_MARKDOWN_BUTTON_ID , ACCORDION_MARKDOWN_CONTENT_ID } from './const' ;
@@ -19,13 +17,11 @@ const AccordionShowdownHandler: React.FC<AccordionShowdownComponentProps> = ({
1917 const expandedModifier = 'pf-m-expanded' ;
2018
2119 buttonElement . className = `pf-c-accordion__toggle ${ ! expanded ? expandedModifier : '' } ` ;
22- contentElement . hidden = ! expanded ;
20+ contentElement . hidden = expanded ;
2321 contentElement . className = `pf-c-accordion__expanded-content ${
2422 ! expanded ? expandedModifier : ''
2523 } `;
26- setExpanded ( ( newExpanded ) => {
27- return ! newExpanded ;
28- } ) ;
24+ setExpanded ( ! expanded ) ;
2925 } ;
3026
3127 useEventListener ( buttonElement , 'click' , handleClick ) ;
You can’t perform that action at this time.
0 commit comments