PluginProbe
Extendify / trunk
Extendify vtrunk
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 0.6.0 All 127 releases
← All changes | src/Assist/components/dashboard/domains/DomainCard.jsx +7 -4 3.0.4 → trunk 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 { __, isRTL } from '@wordpress/i18n';
10 12 import { chevronLeftSmall, 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 DomainCard = ({ task }) => {
15 17 const { completeTask } = useTasksStore();
16 18 const { setDomainActivity } = useDomainActivities();
19 + useDomainViewActivity({ position: 'buy-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: 'buy-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={{
@@ -77,9 +80,9 @@
77 80 />
78 81 </a>
79 82 </div>
80 83 {/*Secondary domains*/}
81 - {domains?.slice(1)?.map((domain) => (
84 + {domains.slice(1).map((domain) => (
82 85 <a
83 86 href={createDomainUrlLink(domainSearchUrl, domain)}
84 87 target="_blank"
85 88 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"