diff --git a/idea/frontend/src/features/dns/hooks/use-dns-filters.ts b/idea/frontend/src/features/dns/hooks/use-dns-filters.ts index 1d472fe38d..af6fb18c9c 100644 --- a/idea/frontend/src/features/dns/hooks/use-dns-filters.ts +++ b/idea/frontend/src/features/dns/hooks/use-dns-filters.ts @@ -22,6 +22,7 @@ function useDnsFilters() { return owner === 'all' ? {} : { createdBy: decodedAddress }; }; + // eslint-disable-next-line react-hooks/exhaustive-deps const params = useMemo(() => ({ ...getOwnerParams(), orderByField, orderByDirection }), [values, account]); return [values, params, setValues] as const; diff --git a/idea/frontend/src/features/dns/hooks/use-send-dns-transaction.ts b/idea/frontend/src/features/dns/hooks/use-send-dns-transaction.ts index 7c11bc7855..4ece2974e3 100644 --- a/idea/frontend/src/features/dns/hooks/use-send-dns-transaction.ts +++ b/idea/frontend/src/features/dns/hooks/use-send-dns-transaction.ts @@ -1,4 +1,4 @@ -import { useAccount, useAlert, usePrepareProgramTransaction, useProgram } from '@gear-js/react-hooks'; +import { useAccount, useAlert, useBalanceFormat, usePrepareProgramTransaction, useProgram } from '@gear-js/react-hooks'; import { useQuery } from '@tanstack/react-query'; import { Method } from '@/features/explorer'; @@ -15,6 +15,7 @@ type FunctionName = typeof FUNCTION_NAME[keyof typeof FUNCTION_NAME]; const useSendDnsTransaction = (functionName: T) => { const { account } = useAccount(); + const { getFormattedBalance } = useBalanceFormat(); const alert = useAlert(); const [isLoading, enableLoading, disableLoading] = useLoading(); @@ -43,9 +44,10 @@ const useSendDnsTransaction = (functionName: T) => { try { const { transaction, awaited } = await prepareTransactionAsync({ args }); + const formattedFee = getFormattedBalance(awaited.fee.toString()); showModal('transaction', { - fee: awaited.fee.toString(), + fee: `${formattedFee.value} ${formattedFee.unit}`, name: TransactionName.SendMessage, addressFrom: account.address, addressTo: id, diff --git a/idea/frontend/src/features/dns/ui/remove-admin/remove-admin.tsx b/idea/frontend/src/features/dns/ui/remove-admin/remove-admin.tsx index ac36f855c0..7769898f1c 100644 --- a/idea/frontend/src/features/dns/ui/remove-admin/remove-admin.tsx +++ b/idea/frontend/src/features/dns/ui/remove-admin/remove-admin.tsx @@ -19,7 +19,7 @@ type Props = { function RemoveAdmin({ name, address, onSuccess }: Props) { const [isModalOpen, openModal, closeModal] = useModalState(); - const { sendTransaction } = useSendDnsTransaction(FUNCTION_NAME.REMOVE_ADMIN); + const { sendTransaction, isLoading } = useSendDnsTransaction(FUNCTION_NAME.REMOVE_ADMIN); const handleSubmit = () => { const _onSuccess = () => { @@ -43,6 +43,7 @@ function RemoveAdmin({ name, address, onSuccess }: Props) { )} will be removed. Would you like to proceed?`} onSubmit={handleSubmit} close={closeModal} + isLoading={isLoading} /> )} diff --git a/idea/frontend/src/features/sortBy/index.ts b/idea/frontend/src/features/sortBy/index.ts deleted file mode 100644 index 77e80158e5..0000000000 --- a/idea/frontend/src/features/sortBy/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Sort } from './model/consts'; -import { SortBy } from './ui/SortBy'; - -export { Sort, SortBy }; diff --git a/idea/frontend/src/features/sortBy/model/consts.ts b/idea/frontend/src/features/sortBy/model/consts.ts deleted file mode 100644 index 957e039894..0000000000 --- a/idea/frontend/src/features/sortBy/model/consts.ts +++ /dev/null @@ -1,6 +0,0 @@ -enum Sort { - Last = 'last', - First = 'first', -} - -export { Sort }; diff --git a/idea/frontend/src/features/sortBy/ui/SortBy.module.scss b/idea/frontend/src/features/sortBy/ui/SortBy.module.scss deleted file mode 100644 index 21e67cfad6..0000000000 --- a/idea/frontend/src/features/sortBy/ui/SortBy.module.scss +++ /dev/null @@ -1,43 +0,0 @@ -@use '@/shared/assets/styles/_shared.scss' as *; -@use '@/shared/assets/styles/_variables.scss' as *; - -.content { - display: flex; - align-items: center; - justify-content: space-between; - padding-right: toRem(15); - - .title { - color: $gray800; - font-size: toRem(24); - font-family: 'Kanit'; - font-weight: 500; - line-height: 1.3; - text-transform: capitalize; - } - - .sortByWrapper { - display: flex; - align-items: center; - - .text { - font-family: 'Kanit'; - font-size: $fontSizeSmall; - color: $gray600; - line-height: toRem(18); - letter-spacing: 0.08em; - margin-right: 10px; - } - - .sortByBtn { - color: $lightGray; - font-weight: 400; - font-family: 'Kanit'; - line-height: toRem(20); - - &.first img { - transform: rotate(180deg); - } - } - } -} diff --git a/idea/frontend/src/features/sortBy/ui/SortBy.tsx b/idea/frontend/src/features/sortBy/ui/SortBy.tsx deleted file mode 100644 index f0ef7632f9..0000000000 --- a/idea/frontend/src/features/sortBy/ui/SortBy.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { useState } from 'react'; -import clsx from 'clsx'; -import { Button } from '@gear-js/ui'; - -import arrowDown from '@/shared/assets/images/actions/arrowDown.svg?react'; - -import styles from './SortBy.module.scss'; -import { Sort } from '../model/consts'; - -type Props = { - count: number; - title: string; - onChange: (value: Sort) => void; -}; - -const SortBy = ({ count, title, onChange }: Props) => { - const [sortBy, setSortBy] = useState(Sort.Last); - - const toggleSort = () => { - const value = sortBy === Sort.Last ? Sort.First : Sort.Last; - - setSortBy(value); - onChange(value); - }; - - const buttonText = sortBy === Sort.Last ? 'Last updated' : 'First updated'; - - return ( -
-

- {title}: {count} -

-
- Sort by -
-
- ); -}; - -export { SortBy }; diff --git a/idea/frontend/src/pages/dns/dns.tsx b/idea/frontend/src/pages/dns/dns.tsx index b17278bb59..a4de72f7f1 100644 --- a/idea/frontend/src/pages/dns/dns.tsx +++ b/idea/frontend/src/pages/dns/dns.tsx @@ -41,7 +41,7 @@ const Dns = () => { - {account && } + diff --git a/idea/frontend/src/shared/assets/images/actions/arrowDown.svg b/idea/frontend/src/shared/assets/images/actions/arrowDown.svg deleted file mode 100644 index 54bf117949..0000000000 --- a/idea/frontend/src/shared/assets/images/actions/arrowDown.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file