← All changes
|
src/Agent/workflows/theme/components/change-site-design/SelectSiteDesign.jsx
+5
-20
3.2.0
→
3.2.2
View file →
| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | import { DesignOption } from '@agent/workflows/theme/components/change-site-design/DesignOption'; |
| 8 | 8 | import { fontsOnlyVariation } from '@agent/workflows/theme/components/change-site-design/utils/fontsOnlyVariation'; |
| 9 | 9 | import { removeAnimationClasses } from '@agent/workflows/theme/components/change-site-design/utils/removeAnimationClasses'; |
| 10 | 10 | import { handleSiteImages } from '@auto-launch/fetchers/get-images'; |
| 11 | -import { handleSiteStrings } from '@auto-launch/fetchers/get-strings'; | |
| 12 | 11 | import { useUserSelectionStore } from '@launch/state/user-selections'; |
| 13 | 12 | import { paletteDuotone } from '@shared/lib/palette-preview'; |
| 14 | 13 | import { samplePalettes } from '@shared/lib/palettes'; |
| 15 | 14 | import { safeParseJson } from '@shared/lib/parsing'; |
| @@ -16,9 +15,8 @@ | ||
| 16 | 15 | import { normalizeSiteImages } from '@shared/lib/site-images'; |
| 17 | 16 | import apiFetch from '@wordpress/api-fetch'; |
| 18 | 17 | import { registerCoreBlocks } from '@wordpress/block-library'; |
| 19 | 18 | import { getBlockTypes, parse, serialize } from '@wordpress/blocks'; |
| 20 | -import { Spinner } from '@wordpress/components'; | |
| 21 | 19 | import { useDispatch } from '@wordpress/data'; |
| 22 | 20 | import { useEffect, useMemo, useRef, useState } from '@wordpress/element'; |
| 23 | 21 | import { __ } from '@wordpress/i18n'; |
| 24 | 22 | import classnames from 'classnames'; |
| @@ -233,14 +231,8 @@ | ||
| 233 | 231 | const storedSiteImages = |
| 234 | 232 | stored?.state?.siteImages ?? launchState?.siteImages?.siteImages ?? []; |
| 235 | 233 | const siteProfile = stored?.state?.siteProfile ?? launchState?.siteProfile; |
| 236 | 234 | |
| 237 | - const storedDescription = | |
| 238 | - description ?? | |
| 239 | - stored?.state?.heroDescription ?? | |
| 240 | - launchState?.siteStrings?.heroDescription ?? | |
| 241 | - null; | |
| 242 | - | |
| 243 | 235 | (async () => { |
| 244 | 236 | const siteImages = await resolveSiteImages({ |
| 245 | 237 | storedSiteImages, |
| 246 | 238 | siteProfile, |
| @@ -245,13 +237,8 @@ | ||
| 245 | 237 | storedSiteImages, |
| 246 | 238 | siteProfile, |
| 247 | 239 | }); |
| 248 | 240 | |
| 249 | - const resolvedDescription = | |
| 250 | - storedDescription || !siteProfile | |
| 251 | - ? storedDescription | |
| 252 | - : (await handleSiteStrings({ siteProfile })).heroDescription; | |
| 253 | - | |
| 254 | 241 | apiFetch({ |
| 255 | 242 | path: '/extendify/v1/agent/site-design-variations', |
| 256 | 243 | method: 'POST', |
| 257 | 244 | data: { |
| @@ -258,9 +245,9 @@ | ||
| 258 | 245 | title, |
| 259 | 246 | images: domImages, |
| 260 | 247 | siteImages, |
| 261 | 248 | postId: context?.postId, |
| 262 | - description: resolvedDescription, | |
| 249 | + description, | |
| 263 | 250 | currentHeroPattern: heroPatternName, |
| 264 | 251 | source: 'change-site-design-workflow', |
| 265 | 252 | cta: { |
| 266 | 253 | label: cta?.textContent, |
| @@ -392,9 +379,9 @@ | ||
| 392 | 379 | ); |
| 393 | 380 | } |
| 394 | 381 | |
| 395 | 382 | return ( |
| 396 | - <div className="mb-4 ms-12 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50"> | |
| 383 | + <div className="mb-4 ms-2 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50"> | |
| 397 | 384 | <div className="rounded-lg border-b border-gray-300 bg-white"> |
| 398 | 385 | <div className="flex flex-col gap-4 p-3"> |
| 399 | 386 | {currentHeroHtml && ( |
| 400 | 387 | <DesignOption |
| @@ -495,13 +482,11 @@ | ||
| 495 | 482 | )} |
| 496 | 483 | disabled={!selectedHeroPattern || isSaving} |
| 497 | 484 | onClick={handleConfirm} |
| 498 | 485 | > |
| 499 | - {isSaving ? ( | |
| 500 | - <Spinner className="m-0" /> | |
| 501 | - ) : ( | |
| 502 | - __('Save', 'extendify-local') | |
| 503 | - )} | |
| 486 | + {isSaving | |
| 487 | + ? __('Saving...', 'extendify-local') | |
| 488 | + : __('Save', 'extendify-local')} | |
| 504 | 489 | </button> |
| 505 | 490 | </div> |
| 506 | 491 | </div> |
| 507 | 492 | ); |