PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 All 128 releases
← All changes | src/Assist/components/dashboard/domains/DomainBanner.jsx +8 -5 3.0.4 → 3.2.2 View file →
@@ -1,22 +1,25 @@
1 +import { useDomainViewActivity } from '@assist/hooks/useDomainViewActivity';
1 2 import {
3 + buildDomainViewItems,
2 4 createDomainUrlLink,
3 5 deleteDomainCache,
4 6 domainSearchUrl,
7 + domains,
5 8 } from '@assist/lib/domains';
6 9 import { useDomainActivities } from '@assist/state/domain-activities';
7 10 import { useGlobalStore } from '@assist/state/globals';
8 -import { safeParseJson } from '@shared/lib/parsing';
9 11 import { __ } from '@wordpress/i18n';
10 12 import { close, globe, Icon } from '@wordpress/icons';
11 13
12 -const domains = safeParseJson(window.extSharedData.resourceData)?.domains || [];
14 +const viewItems = buildDomainViewItems(domains.slice(0, 1));
13 15
14 16 export const DomainBanner = () => {
15 17 const { dismissBanner } = useGlobalStore();
16 18 const { setDomainActivity } = useDomainActivities();
19 + useDomainViewActivity({ position: 'buy-banner', items: viewItems });
17 20
18 - if (!domainSearchUrl || !domains?.length) return null;
21 + if (!domainSearchUrl || !domains.length) return null;
19 22
20 23 return (
21 24 <div
22 25 className="relative mb-6 h-full min-h-32 w-full rounded-sm border border-gray-300 bg-white px-5 py-5 text-base lg:px-8 lg:py-6"
@@ -41,15 +44,15 @@
41 44 )}
42 45 </div>
43 46 </div>
44 47 <div className="domain-name-action">
45 - {!domains?.length > 0 && (
48 + {!domains.length && (
46 49 <div className="flex h-full items-center justify-center">
47 50 {__('Service offline. Check back later.', 'extendify-local')}
48 51 </div>
49 52 )}
50 53
51 - {domains?.length > 0 ? (
54 + {domains.length > 0 ? (
52 55 <>
53 56 <div className="mb-4 flex flex-col gap-1">
54 57 <div className="flex items-center gap-1 font-semibold">
55 58 <Icon icon={globe} size={24} className="fill-current" />