| 1 |
import { useMemo } from "@wordpress/element"; |
| 2 |
|
| 3 |
export const useOrientationConfig = ({ postCardPadding, postCardBorder, postCardBorderWidth, contentAreaPadding }) => { |
| 4 |
const emptyDesktopValue = { top: "", right: "", bottom: "", left: "" }; |
| 5 |
return useMemo( |
| 6 |
() => ({ |
| 7 |
orientation_one: { |
| 8 |
// Reset Three Styles |
| 9 |
contentAlignment: "left", |
| 10 |
// Reset Five styles |
| 11 |
postCardPadding: { |
| 12 |
...postCardPadding, |
| 13 |
device: { |
| 14 |
...postCardPadding.device, |
| 15 |
Desktop: emptyDesktopValue, |
| 16 |
}, |
| 17 |
}, |
| 18 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 19 |
postCardBorderWidth: { |
| 20 |
...postCardBorderWidth, |
| 21 |
device: { |
| 22 |
...postCardBorderWidth.device, |
| 23 |
Desktop: emptyDesktopValue, |
| 24 |
}, |
| 25 |
}, |
| 26 |
// Reset Six styles |
| 27 |
contentAreaPadding: { |
| 28 |
...contentAreaPadding, |
| 29 |
device: { |
| 30 |
...contentAreaPadding.device, |
| 31 |
Desktop: emptyDesktopValue, |
| 32 |
}, |
| 33 |
}, |
| 34 |
catTabCategoryPosition: "", |
| 35 |
}, |
| 36 |
orientation_two: { |
| 37 |
// Reset Three Styles |
| 38 |
contentAlignment: "left", |
| 39 |
// Reset Five styles |
| 40 |
postCardPadding: { |
| 41 |
...postCardPadding, |
| 42 |
device: { |
| 43 |
...postCardPadding.device, |
| 44 |
Desktop: emptyDesktopValue, |
| 45 |
}, |
| 46 |
}, |
| 47 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 48 |
postCardBorderWidth: { |
| 49 |
...postCardBorderWidth, |
| 50 |
device: { |
| 51 |
...postCardBorderWidth.device, |
| 52 |
Desktop: emptyDesktopValue, |
| 53 |
}, |
| 54 |
}, |
| 55 |
// Reset six styles |
| 56 |
contentAreaPadding: { |
| 57 |
...contentAreaPadding, |
| 58 |
device: { |
| 59 |
...contentAreaPadding.device, |
| 60 |
Desktop: emptyDesktopValue, |
| 61 |
}, |
| 62 |
}, |
| 63 |
catTabCategoryPosition: "", |
| 64 |
}, |
| 65 |
orientation_three: { |
| 66 |
contentAlignment: "center", |
| 67 |
catTabCategoryPosition: "center-bottom", |
| 68 |
// Reset Five styles |
| 69 |
postCardPadding: { |
| 70 |
...postCardPadding, |
| 71 |
device: { |
| 72 |
...postCardPadding.device, |
| 73 |
Desktop: emptyDesktopValue, |
| 74 |
}, |
| 75 |
}, |
| 76 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 77 |
postCardBorderWidth: { |
| 78 |
...postCardBorderWidth, |
| 79 |
device: { |
| 80 |
...postCardBorderWidth.device, |
| 81 |
Desktop: emptyDesktopValue, |
| 82 |
}, |
| 83 |
}, |
| 84 |
// Reset six styles |
| 85 |
contentAreaPadding: { |
| 86 |
...contentAreaPadding, |
| 87 |
device: { |
| 88 |
...contentAreaPadding.device, |
| 89 |
Desktop: emptyDesktopValue, |
| 90 |
}, |
| 91 |
}, |
| 92 |
}, |
| 93 |
orientation_four: { |
| 94 |
catTabCategoryPosition: "top-right", |
| 95 |
contentAreaPadding: { |
| 96 |
...contentAreaPadding, |
| 97 |
device: { |
| 98 |
...contentAreaPadding.device, |
| 99 |
Desktop: { |
| 100 |
top: 0, |
| 101 |
right: 15, |
| 102 |
bottom: 15, |
| 103 |
left: 15, |
| 104 |
}, |
| 105 |
Tablet: { |
| 106 |
top: 0, |
| 107 |
right: 15, |
| 108 |
bottom: 15, |
| 109 |
left: 15, |
| 110 |
}, |
| 111 |
Mobile: { |
| 112 |
top: 0, |
| 113 |
right: 15, |
| 114 |
bottom: 15, |
| 115 |
left: 15, |
| 116 |
}, |
| 117 |
}, |
| 118 |
}, |
| 119 |
// Reset Three Styles |
| 120 |
contentAlignment: "left", |
| 121 |
// Reset Five styles |
| 122 |
postCardPadding: { |
| 123 |
...postCardPadding, |
| 124 |
device: { |
| 125 |
...postCardPadding.device, |
| 126 |
Desktop: emptyDesktopValue, |
| 127 |
}, |
| 128 |
}, |
| 129 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 130 |
postCardBorderWidth: { |
| 131 |
...postCardBorderWidth, |
| 132 |
device: { |
| 133 |
...postCardBorderWidth.device, |
| 134 |
Desktop: emptyDesktopValue, |
| 135 |
}, |
| 136 |
}, |
| 137 |
}, |
| 138 |
orientation_five: { |
| 139 |
postCardPadding: { |
| 140 |
...postCardPadding, |
| 141 |
device: { |
| 142 |
...postCardPadding.device, |
| 143 |
Desktop: { |
| 144 |
top: 15, |
| 145 |
right: 15, |
| 146 |
bottom: 15, |
| 147 |
left: 15, |
| 148 |
}, |
| 149 |
}, |
| 150 |
}, |
| 151 |
postCardBorder: { ...postCardBorder, style: "solid" }, |
| 152 |
postCardBorderWidth: { |
| 153 |
...postCardBorderWidth, |
| 154 |
device: { |
| 155 |
...postCardBorderWidth.device, |
| 156 |
Desktop: { top: 1, right: 1, bottom: 1, left: 1 }, |
| 157 |
}, |
| 158 |
}, |
| 159 |
// Reset Three Styles |
| 160 |
contentAlignment: "left", |
| 161 |
// Reset Six styles |
| 162 |
contentAreaPadding: { |
| 163 |
...contentAreaPadding, |
| 164 |
device: { |
| 165 |
...contentAreaPadding.device, |
| 166 |
Desktop: emptyDesktopValue, |
| 167 |
}, |
| 168 |
}, |
| 169 |
catTabCategoryPosition: "", |
| 170 |
}, |
| 171 |
orientation_six: { |
| 172 |
contentAreaPadding: { |
| 173 |
...contentAreaPadding, |
| 174 |
device: { |
| 175 |
...contentAreaPadding.device, |
| 176 |
Desktop: { |
| 177 |
top: 15, |
| 178 |
right: 15, |
| 179 |
bottom: 15, |
| 180 |
left: 15, |
| 181 |
}, |
| 182 |
Tablet: { |
| 183 |
top: 12, |
| 184 |
right: 12, |
| 185 |
bottom: 12, |
| 186 |
left: 12, |
| 187 |
}, |
| 188 |
Mobile: { |
| 189 |
top: 12, |
| 190 |
right: 12, |
| 191 |
bottom: 12, |
| 192 |
left: 12, |
| 193 |
}, |
| 194 |
}, |
| 195 |
}, |
| 196 |
// Reset Three Styles |
| 197 |
contentAlignment: "left", |
| 198 |
// Reset Five styles |
| 199 |
postCardPadding: { |
| 200 |
...postCardPadding, |
| 201 |
device: { |
| 202 |
...postCardPadding.device, |
| 203 |
Desktop: emptyDesktopValue, |
| 204 |
}, |
| 205 |
}, |
| 206 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 207 |
postCardBorderWidth: { |
| 208 |
...postCardBorderWidth, |
| 209 |
device: { |
| 210 |
...postCardBorderWidth.device, |
| 211 |
Desktop: emptyDesktopValue, |
| 212 |
}, |
| 213 |
}, |
| 214 |
catTabCategoryPosition: "", |
| 215 |
}, |
| 216 |
orientation_seven: { |
| 217 |
contentAreaPadding: { |
| 218 |
...contentAreaPadding, |
| 219 |
device: { |
| 220 |
...contentAreaPadding.device, |
| 221 |
Desktop: { |
| 222 |
top: 15, |
| 223 |
right: 15, |
| 224 |
bottom: 15, |
| 225 |
left: 15, |
| 226 |
}, |
| 227 |
Tablet: { |
| 228 |
top: 12, |
| 229 |
right: 12, |
| 230 |
bottom: 12, |
| 231 |
left: 12, |
| 232 |
}, |
| 233 |
Mobile: { |
| 234 |
top: 12, |
| 235 |
right: 12, |
| 236 |
bottom: 12, |
| 237 |
left: 12, |
| 238 |
}, |
| 239 |
}, |
| 240 |
}, |
| 241 |
// Reset Three Styles |
| 242 |
contentAlignment: "left", |
| 243 |
// Reset Five styles |
| 244 |
postCardPadding: { |
| 245 |
...postCardPadding, |
| 246 |
device: { |
| 247 |
...postCardPadding.device, |
| 248 |
Desktop: { |
| 249 |
top: "", |
| 250 |
right: "", |
| 251 |
bottom: "", |
| 252 |
left: "", |
| 253 |
}, |
| 254 |
}, |
| 255 |
}, |
| 256 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 257 |
postCardBorderWidth: { |
| 258 |
...postCardBorderWidth, |
| 259 |
device: { |
| 260 |
...postCardBorderWidth.device, |
| 261 |
Desktop: emptyDesktopValue, |
| 262 |
}, |
| 263 |
}, |
| 264 |
catTabCategoryPosition: "", |
| 265 |
}, |
| 266 |
orientation_eight: { |
| 267 |
contentAreaPadding: { |
| 268 |
...contentAreaPadding, |
| 269 |
device: { |
| 270 |
...contentAreaPadding.device, |
| 271 |
Desktop: { |
| 272 |
top: 15, |
| 273 |
right: 15, |
| 274 |
bottom: 15, |
| 275 |
left: 15, |
| 276 |
}, |
| 277 |
Tablet: { |
| 278 |
top: 12, |
| 279 |
right: 12, |
| 280 |
bottom: 12, |
| 281 |
left: 12, |
| 282 |
}, |
| 283 |
Mobile: { |
| 284 |
top: 12, |
| 285 |
right: 12, |
| 286 |
bottom: 12, |
| 287 |
left: 12, |
| 288 |
}, |
| 289 |
}, |
| 290 |
}, |
| 291 |
// Reset Three Styles |
| 292 |
contentAlignment: "left", |
| 293 |
// Reset Five styles |
| 294 |
postCardPadding: { |
| 295 |
...postCardPadding, |
| 296 |
device: { |
| 297 |
...postCardPadding.device, |
| 298 |
Desktop: emptyDesktopValue, |
| 299 |
}, |
| 300 |
}, |
| 301 |
postCardBorder: { ...postCardBorder, style: "" }, |
| 302 |
postCardBorderWidth: { |
| 303 |
...postCardBorderWidth, |
| 304 |
device: { |
| 305 |
...postCardBorderWidth.device, |
| 306 |
Desktop: emptyDesktopValue, |
| 307 |
}, |
| 308 |
}, |
| 309 |
catTabCategoryPosition: "", |
| 310 |
}, |
| 311 |
}), |
| 312 |
[] |
| 313 |
); |
| 314 |
}; |
| 315 |
|