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