| 1 |
import { useMemo } from "@wordpress/element"; |
| 2 |
|
| 3 |
export const useOrientation = ({ |
| 4 |
postCardPadding, |
| 5 |
postCardBorder, |
| 6 |
postCardBorderWidth, |
| 7 |
contentAreaPadding, |
| 8 |
catTabCategoryLineHeight, |
| 9 |
catTabCategoryBorder, |
| 10 |
imageOverlayCustomColor, |
| 11 |
}) => { |
| 12 |
const emptyDesktopValue = { top: "", right: "", bottom: "", left: "" }; |
| 13 |
return useMemo( |
| 14 |
() => ({ |
| 15 |
orientation_one: { |
| 16 |
contentAlignment: "left", |
| 17 |
imageOverlayType: "full", |
| 18 |
catTabCategoryPosition: "", |
| 19 |
|
| 20 |
contentAreaPadding: { |
| 21 |
...contentAreaPadding, |
| 22 |
device: { |
| 23 |
...contentAreaPadding.device, |
| 24 |
Desktop: { |
| 25 |
top: 0, |
| 26 |
right: 20, |
| 27 |
bottom: 20, |
| 28 |
left: 20, |
| 29 |
}, |
| 30 |
}, |
| 31 |
}, |
| 32 |
|
| 33 |
catTabCategoryLineHeight: { |
| 34 |
...catTabCategoryLineHeight, |
| 35 |
device: { |
| 36 |
...catTabCategoryLineHeight.device, |
| 37 |
Desktop: 120, |
| 38 |
Tablet: 120, |
| 39 |
Mobile: 100, |
| 40 |
}, |
| 41 |
unit: { |
| 42 |
...catTabCategoryLineHeight.unit, |
| 43 |
Desktop: "%", |
| 44 |
Tablet: "%", |
| 45 |
Mobile: "%", |
| 46 |
}, |
| 47 |
}, |
| 48 |
catTabCategoryBorder: { |
| 49 |
...catTabCategoryBorder, |
| 50 |
style: "solid", |
| 51 |
}, |
| 52 |
excerptShow: false, |
| 53 |
imageOverlayCustomColor: { |
| 54 |
...imageOverlayCustomColor, |
| 55 |
color: { |
| 56 |
...imageOverlayCustomColor.color, |
| 57 |
solidColor: "#00000080", |
| 58 |
}, |
| 59 |
}, |
| 60 |
}, |
| 61 |
orientations_two: { |
| 62 |
contentAlignment: "center", |
| 63 |
catTabCategoryPosition: "", |
| 64 |
imageOverlayType: "orientations-two", |
| 65 |
excerptShow: false, |
| 66 |
catTabCategoryBorder: { |
| 67 |
...catTabCategoryBorder, |
| 68 |
style: "solid", |
| 69 |
}, |
| 70 |
|
| 71 |
contentAreaPadding: { |
| 72 |
...contentAreaPadding, |
| 73 |
device: { |
| 74 |
...contentAreaPadding.device, |
| 75 |
Desktop: { |
| 76 |
top: 0, |
| 77 |
right: 25, |
| 78 |
bottom: 35, |
| 79 |
left: 25, |
| 80 |
}, |
| 81 |
}, |
| 82 |
}, |
| 83 |
}, |
| 84 |
orientation_three: { |
| 85 |
imageOverlayType: "orientation-three", |
| 86 |
contentAlignment: "left", |
| 87 |
catTabCategoryPosition: "top-left", |
| 88 |
|
| 89 |
postCardPadding: { |
| 90 |
...postCardPadding, |
| 91 |
device: { |
| 92 |
...postCardPadding.device, |
| 93 |
Desktop: emptyDesktopValue, |
| 94 |
}, |
| 95 |
}, |
| 96 |
|
| 97 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 98 |
catTabCategoryBorder: { |
| 99 |
...catTabCategoryBorder, |
| 100 |
style: "none", |
| 101 |
}, |
| 102 |
|
| 103 |
postCardBorderWidth: { |
| 104 |
...postCardBorderWidth, |
| 105 |
device: { |
| 106 |
...postCardBorderWidth.device, |
| 107 |
Desktop: emptyDesktopValue, |
| 108 |
}, |
| 109 |
}, |
| 110 |
excerptShow: false, |
| 111 |
contentAreaPadding: { |
| 112 |
...contentAreaPadding, |
| 113 |
device: { |
| 114 |
...contentAreaPadding.device, |
| 115 |
Desktop: { |
| 116 |
top: 20, |
| 117 |
right: 10, |
| 118 |
bottom: 15, |
| 119 |
left: 10, |
| 120 |
}, |
| 121 |
}, |
| 122 |
}, |
| 123 |
}, |
| 124 |
orientations_four: { |
| 125 |
imageOverlayType: "orientations-four", |
| 126 |
catTabCategoryPosition: "", |
| 127 |
contentAlignment: "center", |
| 128 |
excerptShow: false, |
| 129 |
catTabCategoryBorder: { |
| 130 |
...catTabCategoryBorder, |
| 131 |
style: "solid", |
| 132 |
}, |
| 133 |
|
| 134 |
contentAreaPadding: { |
| 135 |
...contentAreaPadding, |
| 136 |
device: { |
| 137 |
...contentAreaPadding.device, |
| 138 |
Desktop: { |
| 139 |
top: 20, |
| 140 |
right: 20, |
| 141 |
bottom: 20, |
| 142 |
left: 20, |
| 143 |
}, |
| 144 |
}, |
| 145 |
}, |
| 146 |
}, |
| 147 |
}), |
| 148 |
[] |
| 149 |
); |
| 150 |
}; |
| 151 |
|