Skip to content
Merged

Tali #42

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export default function RootLayout({

return (
<ProtectedRoute>
<div className="flex flex-col">
<div className="flex w-screen flex-col">
<TopNav />
<ToastContainer toasts={toasts} onRemoveToast={removeToast} />

<div className="mt-20 relative">
<div className="mt-20 w-full md:max-w-[80%] mx-auto relative">
<button onClick={useBack()} className="absolute cursor-pointer bg-card left-6 top-0">
<ArrowLeft size={20} className="text-foreground" />
</button>
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard/top-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export function TopNav() {
// const isHelp = tabTitle === "Help";

return (
<header className="fixed top-0 left-0 right-0 z-40 bg-background/95 backdrop-blur-md border-b">
<div className="flex h-16 items-center justify-between px-4 lg:px-6">
<header className="fixed w-full max-w-[80%] mx-auto top-0 left-0 right-0 z-40 bg-background/95 backdrop-blur-md border-b">
<div className="flex h-16 items-center justify-between px-4 ">
{/* Actions */}

<div className="w-full flex justify-between px-5">
Expand Down
4 changes: 2 additions & 2 deletions components/hooks/usePurchaseFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ export function usePurchaseFlow({ type }: { type: "airtime" | "data" | "electric

// Current network for selected token
const currentNetwork = useMemo(() => {
if (!addresses) return "testnet";
if (!addresses) return "mainnet";
const addressInfo = addresses.find(
(addr) => (addr.chain || "").toLowerCase() === selectedToken.toLowerCase()
);
return addressInfo?.network || "testnet";
return addressInfo?.network || "mainnet";
}, [addresses, selectedToken]);

// Required crypto amount
Expand Down
6 changes: 3 additions & 3 deletions components/hooks/useTokenBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function useTokenBalance() {
name: getTokenName(chainKey),
symbol,
address: addr.address,
network: addr.network || 'testnet',
network: addr.network || 'mainnet',
balance: 0, // Will be updated from balances
ngnValue: 0,
hasWallet: true,
Expand Down Expand Up @@ -115,7 +115,7 @@ export function useTokenBalance() {
name: getTokenName(chainKey),
symbol,
address: bal.address || '',
network: bal.network || 'testnet',
network: bal.network || 'mainnet',
balance,
ngnValue,
hasWallet: !!bal.address,
Expand Down Expand Up @@ -210,7 +210,7 @@ export function useTokenBalance() {
);

const getWalletNetwork = useCallback((chain: string): string =>
getTokenByChain(chain)?.network || 'testnet',
getTokenByChain(chain)?.network || 'mainnet',
[getTokenByChain]
);

Expand Down
2 changes: 1 addition & 1 deletion components/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const DebugWalletAPI = () => {
const testWalletBalancesEndpoint = async (token: string) => {
try {
const response = await fetch(
'https://velo-node-backend.onrender.com/wallet/balances/testnet',
'https://velo-node-backend.onrender.com/wallet/balances/mainnet',
{
method: 'GET',
headers: {
Expand Down
8 changes: 4 additions & 4 deletions lib/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class ApiClient {
// Wallet methods
async getWalletAddresses(): Promise<WalletAddress[]> {
return this.request<{ addresses: WalletAddress[] }>(
"/wallet/addresses/testnet",
"/wallet/addresses/mainnet",
{ method: "GET" },
{
// Increase TTL to reduce repeated slow calls - addresses rarely change
Expand All @@ -453,7 +453,7 @@ class ApiClient {

async getWalletBalances(): Promise<WalletBalance[]> {
return this.request<{ balances: WalletBalance[] }>(
"/wallet/balances/testnet",
"/wallet/balances/mainnet",
{ method: "GET" },
{
// Increase balance TTL so UI doesn't hammer slow backend; balances
Expand All @@ -471,7 +471,7 @@ class ApiClient {
});

// Invalidate balance cache after sending transaction
this.cache.invalidateCache(["/wallet/balances/testnet"]);
this.cache.invalidateCache(["/wallet/balances/mainnet"]);
return result;
}

Expand Down Expand Up @@ -734,7 +734,7 @@ class ApiClient {

async checkDeploy(): Promise<DepositCheckResponse> {
return this.request<DepositCheckResponse>(
"/checkdeploy/balances/testnet/deploy",
"/checkdeploy/balances/mainnet/deploy",
{
method: "GET",
},
Expand Down