Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"permissions": {
"allow": [
"Bash(npm run build:*)",
"Bash(npx next lint:*)",
"Bash(yarn install)",
"Bash(yarn build)",
"Bash(yarn build:*)",
"Bash(NEXT_TELEMETRY_DISABLED=1 yarn build)",
"Bash(find:*)",
"Bash(pnpm install:*)",
"Bash(pnpm run lint:check:*)",
"Bash(git checkout:*)",
"Bash(pnpm run:*)",
"Bash(pnpm ls:*)",
"Bash(node:*)",
"Bash(npx tsc:*)",
"Bash(pnpm add:*)",
"WebFetch(domain:www.heroui.com)"
],
"deny": []
}
}
11 changes: 7 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
'react/no-unescaped-entities': 'off',

// Performance: Avoid unnecessary renders
'react-perf/jsx-no-new-array-as-prop': 'warn',
'react-perf/jsx-no-new-array-as-prop': 'off',
'react-perf/jsx-no-new-function-as-prop': 'off',

// We prefer function declarations
Expand Down Expand Up @@ -70,7 +70,7 @@ module.exports = {

// Forbid types
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-explicit-any': ['warn', { fixToUnknown: false }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-invalid-void-type': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
Expand Down Expand Up @@ -120,9 +120,9 @@ module.exports = {

// APIs
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/prefer-optional-chain': 'off',

// Hard to migrate
// Errors for all try/catch blocks and any types from third-parties
Expand All @@ -133,6 +133,9 @@ module.exports = {
'react/react-in-jsx-scope': 'off',
'import/extensions': 'off',

// Hook dependency warnings are intentionally skipped to ensure flow
'react-hooks/exhaustive-deps': 'off',

// We prefer sorting imports by groups
'import/order': [
'error',
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.14
22.12
3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion app/admin/stats/components/AssetMetricsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useMemo } from 'react';
import { Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@nextui-org/table';
import { Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@heroui/react';
import Link from 'next/link';
import { FiChevronUp, FiChevronDown, FiExternalLink } from 'react-icons/fi';
import { TokenIcon } from '@/components/TokenIcon';
Expand Down
2 changes: 1 addition & 1 deletion app/admin/stats/components/StatsOverviewCards.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Card, CardBody } from '@nextui-org/card';
import { Card, CardBody } from '@heroui/react';
import { SupportedNetworks, getNetworkName } from '@/utils/networks';
import { PlatformStats } from '@/utils/statsUtils';

Expand Down
4 changes: 2 additions & 2 deletions app/admin/stats/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import React, { useState, useEffect } from 'react';
import { Button } from '@nextui-org/button';
import { Dropdown, DropdownTrigger, DropdownMenu, DropdownItem } from '@nextui-org/dropdown';
import { Button } from '@heroui/react';
import { Dropdown, DropdownTrigger, DropdownMenu, DropdownItem } from '@heroui/react';
import Image from 'next/image';
import { FiChevronDown } from 'react-icons/fi';
import ButtonGroup from '@/components/ButtonGroup';
Expand Down
30 changes: 30 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use client';

import { useEffect } from 'react';
import { Button } from '@/components/common';

export default function AppError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service in production if desired
console.error('App error boundary caught:', error);
}, [error]);

return (
<div className="flex min-h-[60vh] flex-col items-center justify-center gap-4 p-8 text-center">
<h2 className="text-2xl">Something went wrong</h2>
<p className="max-w-xl text-secondary">
This page failed to load some data. Please try again.
</p>
<Button onPress={reset}>Retry</Button>
</div>
);
}



26 changes: 26 additions & 0 deletions app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client';

import { Button } from '@/components/common';

export default function GlobalError({ error, reset }: { error: Error; reset: () => void }) {
return (
<html lang="en" suppressHydrationWarning>
<body>
<div className="flex min-h-screen flex-col items-center justify-center gap-4 p-8 text-center">
<h2 className="text-2xl">Something went wrong</h2>
<p className="max-w-xl text-secondary">
An unexpected error occurred. Please try again. If the issue persists, it may be due to
a transient data source outage.
</p>
<pre className="max-w-xl overflow-auto rounded bg-content3 p-4 text-left text-xs">
{error?.message ?? 'Unknown error'}
</pre>
<Button onPress={reset}>Try again</Button>
</div>
</body>
</html>
);
}



5 changes: 3 additions & 2 deletions app/history/[account]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const metadata: Metadata = {
description: 'View your transaction history on Monarch',
};

export default function HistoryPage({ params }: { params: { account: string } }) {
return <HistoryContent account={params.account} />;
export default async function HistoryPage({ params }: { params: Promise<{ account: string }> }) {
const p = await params;
return <HistoryContent account={p.account} />;
}
3 changes: 1 addition & 2 deletions app/history/components/HistoryTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useMemo, useState, useRef, useEffect } from 'react';
import { Chip, Link, Pagination } from '@nextui-org/react';
import { Table, TableHeader, TableBody, TableColumn, TableRow, TableCell } from '@nextui-org/table';
import { Chip, Link, Pagination, Table, TableHeader, TableBody, TableColumn, TableRow, TableCell } from '@heroui/react';
import { ExternalLinkIcon, ChevronDownIcon, TrashIcon } from '@radix-ui/react-icons';
import moment from 'moment';
import Image from 'next/image';
Expand Down
2 changes: 1 addition & 1 deletion app/info/components/info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use client';

import { useState, useEffect, useRef } from 'react';
import { Button } from '@nextui-org/react';
import { Button } from '@heroui/react';
import Image from 'next/image';
import { FaChevronLeft, FaChevronRight } from 'react-icons/fa';
import { Badge } from '@/components/common/Badge';
Expand Down
8 changes: 6 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ initAnalytics();

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className={`${zen.variable} ${inter.variable} ${monospace.variable}`}>
<body>
<html
lang="en"
suppressHydrationWarning
className={`${zen.variable} ${inter.variable} ${monospace.variable}`}
>
<body suppressHydrationWarning>
<ThemeProviders>
<OnchainProviders>
<ClientProviders>
Expand Down
4 changes: 2 additions & 2 deletions app/market/[chainId]/[marketid]/RateChart.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable react/no-unstable-nested-components */

import React, { useState } from 'react';
import { Card, CardHeader, CardBody } from '@nextui-org/card';
import { Progress } from '@nextui-org/progress';
import { Card, CardHeader, CardBody } from '@heroui/react';
import { Progress } from '@heroui/react';
import {
AreaChart,
Area,
Expand Down
2 changes: 1 addition & 1 deletion app/market/[chainId]/[marketid]/VolumeChart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/no-unstable-nested-components */

import React, { useState } from 'react';
import { Card, CardHeader, CardBody } from '@nextui-org/card';
import { Card, CardHeader, CardBody } from '@heroui/react';
import {
AreaChart,
Area,
Expand Down
3 changes: 1 addition & 2 deletions app/market/[chainId]/[marketid]/components/BorrowsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useMemo, useState } from 'react';
import { Link, Pagination } from '@nextui-org/react';
import { Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@nextui-org/table';
import { Link, Pagination, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@heroui/react';
import { ExternalLinkIcon } from '@radix-ui/react-icons';
import moment from 'moment';
import { Address } from 'viem';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useMemo, useState } from 'react';
import { Link, Pagination } from '@nextui-org/react';
import { Table, TableHeader, TableBody, TableColumn, TableRow, TableCell } from '@nextui-org/table';
import { Link, Pagination, Table, TableHeader, TableBody, TableColumn, TableRow, TableCell } from '@heroui/react';
import { ExternalLinkIcon } from '@radix-ui/react-icons';
import moment from 'moment';
import { Address, formatUnits } from 'viem';
Expand Down
4 changes: 2 additions & 2 deletions app/market/[chainId]/[marketid]/components/PositionStats.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { Card } from '@nextui-org/card';
import { Switch } from '@nextui-org/switch';
import { Card } from '@heroui/react';
import { Switch } from '@heroui/react';
import { ReloadIcon } from '@radix-ui/react-icons';
import { FiUser } from 'react-icons/fi';
import { HiOutlineGlobeAsiaAustralia } from 'react-icons/hi2';
Expand Down
3 changes: 1 addition & 2 deletions app/market/[chainId]/[marketid]/components/SuppliesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useMemo, useState } from 'react';
import { Link, Pagination } from '@nextui-org/react';
import { Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@nextui-org/table';
import { Link, Pagination, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell } from '@heroui/react';
import { ExternalLinkIcon } from '@radix-ui/react-icons';
import moment from 'moment';
import { Address } from 'viem';
Expand Down
10 changes: 5 additions & 5 deletions app/market/[chainId]/[marketid]/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use client';

import { useState, useCallback, useMemo } from 'react';
import { Card, CardHeader, CardBody } from '@nextui-org/card';
import { Card, CardHeader, CardBody } from '@heroui/react';
import { ExternalLinkIcon, ChevronLeftIcon } from '@radix-ui/react-icons';
import Image from 'next/image';
import Link from 'next/link';
Expand Down Expand Up @@ -191,18 +191,18 @@ function MarketContent() {
<div className="container mx-auto px-4 py-8 pb-4 font-zen">
{/* navigation bottons */}
<div className="flex justify-between">
<Button onClick={handleBackToMarkets} size="md" className="mb-4">
<Button onPress={handleBackToMarkets} size="md" className="mb-4">
<ChevronLeftIcon className="mr-2" />
Back to Markets
</Button>

<div className="flex gap-2">
<Button onClick={() => setShowSupplyModal(true)}>Supply</Button>
<Button onClick={() => setShowBorrowModal(true)}>Borrow</Button>
<Button onPress={() => setShowSupplyModal(true)}>Supply</Button>
<Button onPress={() => setShowBorrowModal(true)}>Borrow</Button>
<Button
size="md"
className="mb-4"
onClick={() => {
onPress={() => {
void window.open(
getMarketURL(market.uniqueKey, market.morphoBlue.chain.id),
'_blank',
Expand Down
2 changes: 1 addition & 1 deletion app/markets/components/AdvancedSearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import React, { useState, useEffect, useRef } from 'react';
import { Input } from '@nextui-org/input';
import { Input } from '@heroui/react';
import Image from 'next/image';
import { AiOutlineEnter } from 'react-icons/ai';
import { FaSearch } from 'react-icons/fa';
Expand Down
2 changes: 1 addition & 1 deletion app/markets/components/MarketRowDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tooltip } from '@nextui-org/tooltip';
import { Tooltip } from '@heroui/react';
import { ExternalLinkIcon, QuestionMarkCircledIcon } from '@radix-ui/react-icons';
import { OracleFeedInfo } from '@/components/FeedInfo/OracleFeedInfo';
import { Info } from '@/components/Info/info';
Expand Down
6 changes: 3 additions & 3 deletions app/markets/components/MarketSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Switch,
Input,
Divider,
} from '@nextui-org/react';
} from '@heroui/react';
import { useMarkets } from '@/hooks/useMarkets';

type MarketSettingsModalProps = {
Expand Down Expand Up @@ -234,7 +234,7 @@ export default function MarketSettingsModal({
<Button
key={value}
size="sm"
onClick={() => handleEntriesChange(value)}
onPress={() => handleEntriesChange(value)}
variant={entriesPerPage === value ? 'solid' : 'bordered'}
color={entriesPerPage === value ? 'primary' : 'default'}
className={`min-w-[40px] ${
Expand All @@ -256,7 +256,7 @@ export default function MarketSettingsModal({
className="w-20"
onKeyDown={(e) => e.key === 'Enter' && handleCustomEntriesSubmit()}
/>
<Button size="sm" onClick={handleCustomEntriesSubmit} variant="flat">
<Button size="sm" onPress={handleCustomEntriesSubmit} variant="flat">
Set
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/markets/components/MarketTableBody.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Tooltip } from '@nextui-org/react';
import { Tooltip } from '@heroui/react';
import { motion, AnimatePresence } from 'framer-motion';
import Image from 'next/image';
import { FaShieldAlt } from 'react-icons/fa';
Expand Down Expand Up @@ -171,7 +171,7 @@ export function MarketTableBody({
size="sm"
variant="interactive"
className="text-xs"
onClick={() => {
onPress={() => {
setSelectedMarket(item);
setShowSupplyModal(true);
}}
Expand Down
2 changes: 1 addition & 1 deletion app/markets/components/NetworkFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { Select, SelectItem } from '@nextui-org/react';
import { Select, SelectItem } from '@heroui/react';
import Image from 'next/image';
import { SupportedNetworks, getNetworkImg, isSupportedChain, networks } from '@/utils/networks';

Expand Down
2 changes: 1 addition & 1 deletion app/markets/components/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Pagination as NextUIPagination } from '@nextui-org/react';
import { Pagination as NextUIPagination } from '@heroui/react';

type PaginationProps = {
totalPages: number;
Expand Down
2 changes: 1 addition & 1 deletion app/markets/components/RiskIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tooltip } from '@nextui-org/tooltip';
import { Tooltip } from '@heroui/react';
import { GrStatusGood } from 'react-icons/gr';
import { MdWarning, MdError } from 'react-icons/md';
import { TooltipContent } from '@/components/TooltipContent';
Expand Down
Loading