Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into PE-6993-ant-cu-url
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Jan 27, 2025
2 parents 1cf6221 + 3e83c30 commit 139b72b
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 61 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"@ant-design/icons": "5.4.0",
"@ar.io/sdk": "^3.3.0-alpha.15",
"@ar.io/sdk": "^3.3.1-alpha.1",
"@permaweb/aoconnect": "^0.0.59",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-select": "^2.1.4",
Expand Down
114 changes: 59 additions & 55 deletions src/components/data-display/tables/DomainsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,65 +418,69 @@ const DomainsTable = ({
return (
<div className="flex justify-end w-full">
<span className="flex pr-3 w-fit gap-3">
<Tooltip
message={
!antHandlers?.includes('approvePrimaryName') ||
!antHandlers?.includes('removePrimaryNames')
? 'Update ANT to access Primary Names workflow'
: primaryNameData?.name === row.getValue('name')
? 'Remove Primary Name'
: 'Set Primary Name'
}
icon={
<button
disabled={
!antHandlers?.includes('approvePrimaryName') ||
!antHandlers?.includes('removePrimaryNames')
}
onClick={() => {
const targetName = row.getValue('name') as string;
if (primaryNameData?.name === targetName) {
// remove primary name payload
dispatchTransactionState({
type: 'setTransactionData',
payload: {
names: [targetName],
arioProcessId,
assetId: row.getValue('processId'),
functionName: 'removePrimaryNames',
},
});
} else {
dispatchTransactionState({
type: 'setTransactionData',
payload: {
name: targetName,
arioProcessId,
assetId: arioProcessId,
functionName: 'primaryNameRequest',
},
});
{row.getValue('role') === 'owner' ? (
<Tooltip
message={
!antHandlers?.includes('approvePrimaryName') ||
!antHandlers?.includes('removePrimaryNames')
? 'Update ANT to access Primary Names workflow'
: primaryNameData?.name === row.getValue('name')
? 'Remove Primary Name'
: 'Set Primary Name'
}
icon={
<button
disabled={
!antHandlers?.includes('approvePrimaryName') ||
!antHandlers?.includes('removePrimaryNames')
}
onClick={() => {
const targetName = row.getValue('name') as string;
if (primaryNameData?.name === targetName) {
// remove primary name payload
dispatchTransactionState({
type: 'setTransactionData',
payload: {
names: [targetName],
arioProcessId,
assetId: row.getValue('processId'),
functionName: 'removePrimaryNames',
},
});
} else {
dispatchTransactionState({
type: 'setTransactionData',
payload: {
name: targetName,
arioProcessId,
assetId: arioProcessId,
functionName: 'primaryNameRequest',
},
});
}

dispatchModalState({
type: 'setModalOpen',
payload: { showPrimaryNameModal: true },
});
}}
>
<Star
className={
(row.getValue('name') == primaryNameData?.name
? 'text-primary fill-primary'
: 'text-grey') +
`
dispatchModalState({
type: 'setModalOpen',
payload: { showPrimaryNameModal: true },
});
}}
>
<Star
className={
(row.getValue('name') == primaryNameData?.name
? 'text-primary fill-primary'
: 'text-grey') +
`
w-[18px]
`
}
/>
</button>
}
/>
}
/>
</button>
}
/>
) : (
<></>
)}
<ManageAssetButtons
id={lowerCaseDomain(row.getValue('name') as string)}
assetType="names"
Expand Down
6 changes: 5 additions & 1 deletion src/components/pages/ManageDomain/ManageDomain.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import TransactionSuccessCard from '@src/components/cards/TransactionSuccessCard/TransactionSuccessCard';
import { AntLogoIcon } from '@src/components/data-display/AntLogoIcon';
import DomainSettings from '@src/components/forms/DomainSettings/DomainSettings';
import useDomainInfo from '@src/hooks/useDomainInfo';
import { usePrimaryName } from '@src/hooks/usePrimaryName';
import { useGlobalState, useModalState, useWalletState } from '@src/state';
import { useTransactionState } from '@src/state/contexts/TransactionState';
Expand All @@ -19,9 +20,12 @@ function ManageDomain() {
useTransactionState();
const [, dispatchModalState] = useModalState();
const { data: primaryNameData } = usePrimaryName();
const { data: domainData } = useDomainInfo({ domain: name });
const [{ walletAddress }] = useWalletState();

const isOwner = walletAddress?.toString() === primaryNameData?.owner;
const isOwner = walletAddress
? walletAddress.toString() === domainData?.info?.Owner
: false;

const [logoId, setLogoId] = useState<string | undefined>();

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
plimit-lit "^3.0.1"
warp-contracts "1.4.45"

"@ar.io/sdk@^3.3.0-alpha.15":
version "3.3.0-alpha.15"
resolved "https://registry.yarnpkg.com/@ar.io/sdk/-/sdk-3.3.0-alpha.15.tgz#5b0a2a469056dfc2e025607d7d172b3b8ed0f326"
integrity sha512-UUEH3oZXhXDPmPP18RvNO816P9Uho95zgikI1Zj7mGi/EIzEBU//34Yb6vzMx9/x2bKUmYPbkgTiBOm0RTeKcw==
"@ar.io/sdk@^3.3.1-alpha.1":
version "3.3.1-alpha.1"
resolved "https://registry.yarnpkg.com/@ar.io/sdk/-/sdk-3.3.1-alpha.1.tgz#92ab6a513cc0d9c58c349c1e59a3ae4f5378b737"
integrity sha512-l9Ig5C8KiwCO1rzWnMJmGgYaVozaMiX5qIB7Y6rXW8rTMut7GCzlLSjzhmkeJ9bu2/PUY6jeF0mWyJ//uN6W+A==
dependencies:
"@dha-team/arbundles" "^1.0.1"
"@permaweb/aoconnect" "^0.0.57"
Expand Down

0 comments on commit 139b72b

Please sign in to comment.