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/SecondaryDomainCard.jsx +7 -4 3.0.4 → 3.2.2 View file →
@@ -1,20 +1,23 @@
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 { useTasksStore } from '@assist/state/tasks';
8 -import { safeParseJson } from '@shared/lib/parsing';
9 11 import { __ } from '@wordpress/i18n';
10 12 import { chevronRightSmall, Icon } from '@wordpress/icons';
11 13
12 -const domains = safeParseJson(window.extSharedData.resourceData)?.domains || [];
14 +const viewItems = buildDomainViewItems(domains);
13 15
14 16 export const SecondaryDomainCard = ({ task }) => {
15 17 const { completeTask } = useTasksStore();
16 18 const { setDomainActivity } = useDomainActivities();
19 + useDomainViewActivity({ position: 'addon-task', items: viewItems });
17 20
18 21 const handleInteract = () => {
19 22 completeTask(task.slug);
20 23 deleteDomainCache();
@@ -22,9 +25,9 @@
22 25
23 26 const recordActivity = (domain, type) =>
24 27 setDomainActivity({ domain, position: 'addon-task', type });
25 28
26 - if (!domains?.length) {
29 + if (!domains.length) {
27 30 return (
28 31 <div
29 32 className="flex h-full w-full items-center justify-center bg-cover bg-right-bottom bg-no-repeat"
30 33 style={{
@@ -76,9 +79,9 @@
76 79 <Icon icon={chevronRightSmall} className="fill-current" />
77 80 </a>
78 81 </div>
79 82 {/*Secondary domains*/}
80 - {domains?.slice(1)?.map((domain) => (
83 + {domains.slice(1).map((domain) => (
81 84 <a
82 85 href={createDomainUrlLink(domainSearchUrl, domain)}
83 86 target="_blank"
84 87 className="flex h-11 cursor-pointer items-center justify-between border-b border-gray-200 px-6 py-3.5 text-sm font-normal lowercase text-gray-800 no-underline last:border-transparent hover:bg-gray-50"