-
-
- {selection
- ? `${selectedTokenIds.length} Selected`
- : "Select all"}
+ {canPerformActions && (
+
+
+
+ {selection
+ ? `${selectedTokenIds.length} Selected`
+ : "Select all"}
+
-
+ )}
{assets.map((asset) => {
@@ -150,7 +156,7 @@ export function Collection() {
state={location.state}
key={asset.tokenId}
onClick={(e: React.MouseEvent) => {
- if (selection) {
+ if (selection && canPerformActions) {
e.preventDefault();
handleSelect(asset.tokenId);
}
@@ -165,10 +171,12 @@ export function Collection() {
: `${asset.name} #${parseInt(BigInt(asset.tokenId).toString())}`
}
image={asset.imageUrl || placeholder}
- selectable
+ selectable={canPerformActions}
selected={isSelected}
listingCount={listingCount}
- onSelect={() => handleSelect(asset.tokenId)}
+ onSelect={() =>
+ canPerformActions && handleSelect(asset.tokenId)
+ }
className="rounded overflow-hidden"
/>
@@ -177,40 +185,42 @@ export function Collection() {
-
-
-
-
+
+ )}
>
)}
>
diff --git a/packages/keychain/src/components/inventory/token/token.tsx b/packages/keychain/src/components/inventory/token/token.tsx
index d05498eda1..07f6e3b3d5 100644
--- a/packages/keychain/src/components/inventory/token/token.tsx
+++ b/packages/keychain/src/components/inventory/token/token.tsx
@@ -22,6 +22,7 @@ import { useCallback, useMemo } from "react";
import { useConnection } from "@/hooks/connection";
import { useVersion } from "@/hooks/version";
import { useNavigation } from "@/context/navigation";
+import { useViewerAddress } from "@/hooks/viewer";
export function Token() {
const { address } = useParams<{ address: string }>();
@@ -38,6 +39,7 @@ function Credits() {
// TODO: Get parent from keychain connection if needed
const { navigate } = useNavigation();
const account = useAccount();
+ const { canPerformActions } = useViewerAddress();
const username = account?.username || "";
const credit = useCreditBalance({
username,
@@ -70,15 +72,17 @@ function Credits() {
-