(
- ({ children, className, ...props }, ref) => {
+ ({ children, className, isDisabledHoverStyle, ...props }, ref) => {
return (
(
'border-mono-40 dark:border-mono-140',
'text-mono-140 dark:text-mono-60',
'bg-mono-0 dark:bg-mono-180',
- 'group-hover/tr:bg-blue-0 dark:group-hover/tr:bg-mono-160',
+ !isDisabledHoverStyle &&
+ 'group-hover/tr:bg-blue-0 dark:group-hover/tr:bg-mono-160',
),
className,
)}
diff --git a/libs/webb-ui-components/src/components/Table/Table.tsx b/libs/webb-ui-components/src/components/Table/Table.tsx
index 31051a37b..9f05025a7 100644
--- a/libs/webb-ui-components/src/components/Table/Table.tsx
+++ b/libs/webb-ui-components/src/components/Table/Table.tsx
@@ -8,18 +8,19 @@ import { THeaderMemo as THeader } from './THeader';
import { TableProps } from './types';
export const Table = ({
+ isDisabledRowHoverStyle,
isDisplayFooter,
isPaginated,
- tableProps: table,
- totalRecords = 0,
+ onRowClick,
+ paginationClassName,
tableClassName,
+ tableProps: table,
tableWrapperClassName,
- thClassName,
- trClassName,
tdClassName,
- paginationClassName,
+ thClassName,
title,
- onRowClick,
+ totalRecords = 0,
+ trClassName,
ref,
...props
}: TableProps) => {
@@ -70,7 +71,11 @@ export const Table = ({
onClick={getRowClickHandler(row)}
>
{row.getVisibleCells().map((cell) => (
-
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
))}
diff --git a/libs/webb-ui-components/src/components/Table/types.ts b/libs/webb-ui-components/src/components/Table/types.ts
index 1b5e255e1..6d74ca324 100644
--- a/libs/webb-ui-components/src/components/Table/types.ts
+++ b/libs/webb-ui-components/src/components/Table/types.ts
@@ -76,6 +76,8 @@ export interface TableProps
* The optional ref to forward to the table component
*/
ref?: React.Ref;
+
+ isDisabledRowHoverStyle?: boolean;
}
/**
@@ -86,4 +88,6 @@ export interface THeaderProps extends PropsOf<'th'>, IWebbComponentBase {}
/**
* The `TData` props
*/
-export interface TDataProps extends PropsOf<'td'>, IWebbComponentBase {}
+export interface TDataProps extends PropsOf<'td'>, IWebbComponentBase {
+ isDisabledHoverStyle?: boolean;
+}
diff --git a/libs/webb-ui-components/src/components/TransactionInputCard/TransactionInputCard.tsx b/libs/webb-ui-components/src/components/TransactionInputCard/TransactionInputCard.tsx
index 0a7cedec6..292284a9b 100644
--- a/libs/webb-ui-components/src/components/TransactionInputCard/TransactionInputCard.tsx
+++ b/libs/webb-ui-components/src/components/TransactionInputCard/TransactionInputCard.tsx
@@ -98,42 +98,58 @@ TransactionInputCardRoot.displayName = 'TransactionInputCardRoot';
const TransactionChainSelector = forwardRef<
React.ElementRef<'button'>,
TransactionChainSelectorProps
->(({ typedChainId: typedChainIdProps, className, disabled, ...props }, ref) => {
- const context = useContext(TransactionInputCardContext);
+>(
+ (
+ {
+ typedChainId: typedChainIdProps,
+ className,
+ disabled,
+ placeholder = 'Select Chain',
+ renderBody,
+ ...props
+ },
+ ref,
+ ) => {
+ const context = useContext(TransactionInputCardContext);
- const typedChainId = typedChainIdProps ?? context.typedChainId;
- const chain = typedChainId ? chainsConfig[typedChainId] : undefined;
+ const typedChainId = typedChainIdProps ?? context.typedChainId;
+ const chain = typedChainId ? chainsConfig[typedChainId] : undefined;
- return (
-
- );
-});
+ {!disabled && (
+
+ )}
+
+ );
+ },
+);
TransactionChainSelector.displayName = 'TransactionChainSelector';
const TransactionButton = forwardRef<
diff --git a/libs/webb-ui-components/src/components/TransactionInputCard/types.ts b/libs/webb-ui-components/src/components/TransactionInputCard/types.ts
index 4f46f4c61..b6ca78965 100644
--- a/libs/webb-ui-components/src/components/TransactionInputCard/types.ts
+++ b/libs/webb-ui-components/src/components/TransactionInputCard/types.ts
@@ -60,7 +60,14 @@ export interface TransactionInputCardRootProps
export interface TransactionChainSelectorProps
extends PropsOf<'button'>,
- Pick {}
+ Pick {
+ /**
+ * @default 'Select Chain'
+ */
+ placeholder?: string;
+
+ renderBody?: () => ReactNode;
+}
export interface TransactionButtonProps extends PropsOf<'button'> {
/**
diff --git a/libs/webb-ui-components/src/hooks/useModal.ts b/libs/webb-ui-components/src/hooks/useModal.ts
index 75038674a..b8e273d54 100644
--- a/libs/webb-ui-components/src/hooks/useModal.ts
+++ b/libs/webb-ui-components/src/hooks/useModal.ts
@@ -1,7 +1,6 @@
'use client';
-import { noop } from 'lodash';
-import { useCallback, useEffect, useRef, useState } from 'react';
+import { useCallback, useState } from 'react';
interface ReturnData {
close: () => void;
@@ -11,20 +10,14 @@ interface ReturnData {
update: (status: boolean) => void;
}
-export const useModal = (
- defaultStatus = false,
- callback?: () => void,
-): ReturnData => {
+export const useModal = (defaultStatus = false): ReturnData => {
const [status, setStatus] = useState(defaultStatus);
+
const open = useCallback((): void => setStatus(true), []);
const close = useCallback((): void => setStatus(false), []);
- const toggle = useCallback((): void => setStatus(!status), [status]);
- const _callback = useRef<() => void>(callback || noop);
- const update = useCallback((status: boolean): void => setStatus(status), []);
- useEffect(() => {
- _callback.current();
- }, [status, _callback]);
+ const toggle = useCallback((): void => setStatus((prev) => !prev), []);
+ const update = useCallback((status: boolean): void => setStatus(status), []);
return { close, open, status, toggle, update };
};
diff --git a/tools/scripts/setupMultiAssetDelegationPallet.ts b/tools/scripts/setupMultiAssetDelegationPallet.ts
index fa751fa85..3244637f3 100644
--- a/tools/scripts/setupMultiAssetDelegationPallet.ts
+++ b/tools/scripts/setupMultiAssetDelegationPallet.ts
@@ -1,6 +1,9 @@
import chalk from 'chalk';
import { ApiPromise, Keyring, WsProvider } from '@polkadot/api';
-import { TANGLE_LOCAL_WS_RPC_ENDPOINT } from '@webb-tools/dapp-config/constants/tangle';
+import {
+ TANGLE_LOCAL_WS_RPC_ENDPOINT,
+ TANGLE_TOKEN_DECIMALS,
+} from '@webb-tools/dapp-config/constants/tangle';
import { parseUnits } from 'viem';
import { formatBalance, stringToU8a } from '@polkadot/util';
import { encodeAddress } from '@polkadot/util-crypto';
@@ -55,6 +58,7 @@ success(
const keyring = new Keyring({ type: 'sr25519' });
const ALICE_SUDO = keyring.addFromUri('//Alice');
const BOB = keyring.addFromUri('//Bob');
+const DAVE = keyring.addFromUri('//Dave');
type Asset = {
id: number;
@@ -151,6 +155,13 @@ await api.tx.sudo
.signAndSend(ALICE_SUDO, { nonce });
success('Assets whitelisted for the multi-asset-delegation pallet!');
+info('Join operators for DAVE');
+nonce = await api.rpc.system.accountNextIndex(DAVE.address);
+await api.tx.multiAssetDelegation
+ .joinOperators(parseUnits(MINIMUM_BALANCE_UINT, TANGLE_TOKEN_DECIMALS))
+ .signAndSend(DAVE, { nonce });
+success('DAVE joined the operators successfully!');
+
console.log(
chalk.bold.green(
'✨ Pallet `multi-asset-delegation` setup completed successfully! ✨',
|