import { __ } from "@wordpress/i18n";
import { Toggle, SPRangeControl, SelectField, InputControl, Layouts } from "../../components";
import { AlignCenter, AlignLeft, AlignRight, CarouselTwoOrientationFourIcon, CarouselTwoOrientationOneIcon, CarouselTwoOrientationThreeIcon, CarouselTwoOrientationTwoIcon } from "../../icons/icons";
import { getPaginationBlock } from "../shared/helpFn";
import { openLinksOptions } from "../../controls/constants";
import SPToggleGroupControl from "../../components/toggleGroupControl/toggleGroupControl";
import ContentOrientations from "../shared/templates/templates-parts/contentOrientations";
import { useOrientation } from "../../hooks/useOrientation";
import ProInfo from "../../components/proInfo/proInfo";
export const GridTwoGeneralTab = ({ attributes, setAttributes }) => {
const {
gridTwoColumns,
gridTwoHorizontalGap,
gridTwoVerticalGap,
contentAlignment,
preloaderEnable,
generalLinkOpen,
postLimit,
smallItemHeight,
paginationEnable,
liveFilterEnable,
clientId,
contentOrientation,
blockName,
// orientations
postCardPadding,
postCardBorder,
postCardBorderWidth,
contentAreaPadding,
catTabCategoryBg,
catTabCategoryColor,
catTabCategoryLineHeight,
catTabCategoryFontSize,
catTabCategoryBorder,
metaTypography,
metaFontSize,
imageOverlayCustomColor,
contentOnHover,
} = attributes;
// const layouts = useLayouts( blockName, postGridLayout );
const orientationConfig = useOrientation({
postCardPadding,
postCardBorder,
postCardBorderWidth,
contentAreaPadding,
catTabCategoryBg,
catTabCategoryColor,
catTabCategoryLineHeight,
catTabCategoryFontSize,
catTabCategoryBorder,
metaTypography,
metaFontSize,
imageOverlayCustomColor,
});
const paginationBlock = getPaginationBlock(clientId);
const paginationToggle = (newValue) => {
setAttributes({ paginationEnable: !newValue });
if (!newValue && paginationBlock) {
const { block, select } = paginationBlock;
select(block?.clientId);
}
};
const orientationHandler = (newValue) => {
if (newValue === contentOrientation) {
return;
}
const newData = {
contentOrientation: newValue,
...orientationConfig[newValue],
};
setAttributes(newData);
};
return (
<>
{/* { layouts?.length > 0 && (
) } */}
{/* */}
,
value: "orientation_one",
},
{
icon: ,
value: "orientations_two",
type: "pro",
demoLink: "https://wpsmartpost.com/blocks/#demoId3504"
},
{
icon: ,
value: "orientation_three",
type: "pro",
demoLink: "https://wpsmartpost.com/blocks/#demoId3504"
},
{
icon: ,
value: "orientations_four",
type: "pro",
demoLink: "https://wpsmartpost.com/blocks/#demoId3504"
},
]}
/>
{/* { ! gridTwoMasonryEnable && ( */}
{/* ) } */}
{/* { gridTwoMasonryEnable && (
) } */}
, value: "left" },
{ label: , value: "center" },
{ label: , value: "right" },
]}
/>
{/* Hide Masonry option from Grid two. */}
{/* */}
Unlock exclusive layouts and advanced display controls. Upgrade to Pro!
>
);
};