diff --git a/components/AddressInput.tsx b/components/AddressInput.tsx new file mode 100644 index 0000000..854a458 --- /dev/null +++ b/components/AddressInput.tsx @@ -0,0 +1,30 @@ +import { FC } from 'react' + +// delete if not needed +export interface Props { + value: string + onChange: (value: string) => void +} + +const AddressInput: FC = ({ value, onChange }) => { + return ( +
+ + { + console.log(value, validity.patternMismatch) + if (!validity.patternMismatch) onChange(value) + }} + /> +
+ ) +} + +export default AddressInput diff --git a/components/Balance.tsx b/components/Balance.tsx index 7a0a9b0..5e8103c 100644 --- a/components/Balance.tsx +++ b/components/Balance.tsx @@ -41,22 +41,20 @@ const Balance: FC = ({ className }) => { const xnoBalanceDisplay = rawToNanoDisplay(account?.balance ?? '0') return ( -
+
setPreference('showCurrencyDash', nextShowCurrency(showCurrencyDash)) } - className="hover:cursor-pointer active:translate-y-0.5" + className="hover:cursor-pointer" >

- Ӿ + Ӿ {showXnoBalance ? ( account?.balance === null ? ( @@ -76,7 +74,7 @@ const Balance: FC = ({ className }) => {

{showFiatBalance && ( -

+

$ {(Number(xnoBalance) * xnoPrice).toFixed(2)}

)} diff --git a/components/BottomMenu.tsx b/components/BottomMenu.tsx index 73de384..752609a 100644 --- a/components/BottomMenu.tsx +++ b/components/BottomMenu.tsx @@ -117,7 +117,7 @@ const BottomMenu: FC = ({ className }) => {
- + = () => { hasMore, loading: loadingHistory, hasHistory, + revalidate: refetchHistory, } = useAccountHistory() const hasReceivable = @@ -33,11 +36,34 @@ const RecentTransactions: FC = () => { const initialLoading = loadingHistory && accountHistory === undefined + const onIncomingClick = async (receivable: { + hash: string + amount: string + from: string + timestamp: string + }) => { + await receive(receivable.hash, receivable.amount) + onBlockReceived(receivable.hash) + refetchHistory() + + showNotification({ + title: 'received!', + body: `received Ӿ${convert(receivable.amount, { + from: Unit.raw, + to: Unit.Nano, + })} from ${receivable.from}`, + tag: 'received', + }) + } + return ( <> {hasReceivable && (
-
+
setReceivablesExpanded(prev => !prev)} + >

incoming

@@ -46,7 +72,6 @@ const RecentTransactions: FC = () => { {receivableBlocks.length} setReceivablesExpanded(prev => !prev)} className={clsx( 'h-8 transition-transform-child origin-center-child', { @@ -68,10 +93,7 @@ const RecentTransactions: FC = () => { >