| 1 |
import { __ } from "@wordpress/i18n"; |
| 2 |
import { PanelBody } from "@wordpress/components"; |
| 3 |
import { TabControls } from "../../components"; |
| 4 |
import { PostSliderTwoLayoutTab, PostSliderTwoSliderTab } from "./generalTab"; |
| 5 |
import SharedInspectors from "../shared/inspectors"; |
| 6 |
import { usePanelBodyContext } from "../../context"; |
| 7 |
|
| 8 |
const Inspector = ({ attributes, setAttributes }) => { |
| 9 |
// const { togglePanelBody, openedAccordion } = manageOpenAccordion(); |
| 10 |
const { openPanel, togglePanelBody } = usePanelBodyContext(); |
| 11 |
const { |
| 12 |
// postSliderTwoNavArrow, |
| 13 |
// postSliderTwoPaginationDot |
| 14 |
} = attributes; |
| 15 |
|
| 16 |
return ( |
| 17 |
<> |
| 18 |
<PanelBody |
| 19 |
title={__("Post Slider", "post-carousel")} |
| 20 |
opened={openPanel === "general"} |
| 21 |
onToggle={() => togglePanelBody("general")} |
| 22 |
initialOpen={true} |
| 23 |
> |
| 24 |
{openPanel === "general" && ( |
| 25 |
<TabControls |
| 26 |
attributes={attributes} |
| 27 |
setAttributes={setAttributes} |
| 28 |
GeneralTab={PostSliderTwoLayoutTab} |
| 29 |
SliderTab={PostSliderTwoSliderTab} |
| 30 |
/> |
| 31 |
)} |
| 32 |
</PanelBody> |
| 33 |
{/* { postSliderTwoNavArrow && ( |
| 34 |
<PanelBody |
| 35 |
title={ __( 'Navigation Arrow', 'post-carousel' ) } |
| 36 |
opened={ openPanel === 'navigation' } |
| 37 |
onToggle={ () => togglePanelBody( 'navigation' ) } |
| 38 |
> |
| 39 |
{ openPanel === 'navigation' && ( |
| 40 |
<TabControls |
| 41 |
attributes={ attributes } |
| 42 |
setAttributes={ setAttributes } |
| 43 |
GeneralTab={ CarouselNavArrowGeneralTab } |
| 44 |
StyleTab={ CarouselNavArrowStyleTab } |
| 45 |
/> |
| 46 |
) } |
| 47 |
</PanelBody> |
| 48 |
) } |
| 49 |
{ postSliderTwoPaginationDot && ( |
| 50 |
<PanelBody |
| 51 |
title={ __( 'Pagination Dots', 'post-carousel' ) } |
| 52 |
opened={ openPanel === 'pagination' } |
| 53 |
onToggle={ () => togglePanelBody( 'pagination' ) } |
| 54 |
> |
| 55 |
{ openPanel === 'pagination' && ( |
| 56 |
<TabControls |
| 57 |
attributes={ attributes } |
| 58 |
setAttributes={ setAttributes } |
| 59 |
GeneralTab={ CarouselPaginationGeneralTab } |
| 60 |
StyleTab={ CarouselPaginationStyleTab } |
| 61 |
/> |
| 62 |
) } |
| 63 |
</PanelBody> |
| 64 |
) } */} |
| 65 |
{/* <PanelBody |
| 66 |
title={ __( 'General', 'post-carousel' ) } |
| 67 |
opened={ openPanel === 'general' } |
| 68 |
onToggle={ () => togglePanelBody( 'general' ) } |
| 69 |
> |
| 70 |
{ openPanel === 'general' && ( |
| 71 |
<PostSliderTwoGeneralTab |
| 72 |
attributes={ attributes } |
| 73 |
setAttributes={ setAttributes } |
| 74 |
/> |
| 75 |
) } |
| 76 |
</PanelBody> */} |
| 77 |
<SharedInspectors |
| 78 |
attributes={attributes} |
| 79 |
setAttributes={setAttributes} |
| 80 |
togglePanelBody={togglePanelBody} |
| 81 |
openedAccordion={openPanel} |
| 82 |
/> |
| 83 |
</> |
| 84 |
); |
| 85 |
}; |
| 86 |
|
| 87 |
export default Inspector; |
| 88 |
|