Skip to content

Commit 90a00ca

Browse files
committed
refactor: migrate from nextui to heroui
1 parent 0621d66 commit 90a00ca

File tree

15 files changed

+257
-250
lines changed

15 files changed

+257
-250
lines changed

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
public-hoist-pattern[]=*@nextui-org/*
1+
public-hoist-pattern[]=*@heroui/*

next.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
*/
99
import './src/env.js';
1010

11-
/** @type {import('next').NextConfig} */
11+
import type { NextConfig } from 'next';
12+
1213
const nextConfig = {
1314
reactStrictMode: true,
1415
eslint: {
@@ -18,6 +19,6 @@ const nextConfig = {
1819
config.externals.push('pino-pretty', 'lokijs', 'encoding');
1920
return config;
2021
}
21-
};
22+
} satisfies NextConfig;
2223

2324
export default nextConfig;

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"test:ui": "playwright test --ui"
2525
},
2626
"dependencies": {
27-
"@nextui-org/button": "^2.2.9",
28-
"@nextui-org/skeleton": "^2.2.5",
29-
"@nextui-org/system": "^2.4.6",
30-
"@nextui-org/theme": "^2.4.5",
27+
"@heroui/button": "^2.2.9",
28+
"@heroui/skeleton": "^2.2.5",
29+
"@heroui/system": "^2.4.6",
30+
"@heroui/theme": "^2.4.5",
3131
"@radix-ui/react-dialog": "^1.1.5",
3232
"@radix-ui/react-dropdown-menu": "^2.1.5",
3333
"@radix-ui/react-slot": "^1.1.1",

pnpm-lock.yaml

Lines changed: 222 additions & 216 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/counter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useState } from 'react';
44

5-
import { Button } from '@nextui-org/button';
5+
import { Button } from '@heroui/button';
66

77
import { Card, CardContent, CardHeader } from './ui/card';
88

src/components/navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { Skeleton } from '@nextui-org/skeleton';
3+
import { Skeleton } from '@heroui/skeleton';
44
import dynamic from 'next/dynamic';
55

66
const ThemeToggle = dynamic(() => import('./ui/theme-toggle'), {

src/components/providers/hero-ui.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client';
2+
3+
import React from 'react';
4+
5+
import type { PropsWithChildren } from 'react';
6+
7+
import { HeroUIProvider } from '@heroui/system';
8+
9+
type THeroUiProvider = PropsWithChildren;
10+
11+
export default function HeroUiProvider({ children }: THeroUiProvider) {
12+
return <HeroUIProvider>{children}</HeroUIProvider>;
13+
}

src/components/providers/next-ui.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/components/providers/root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import React from 'react';
22

33
import type { PropsWithChildren } from 'react';
44

5-
import NextUiProvider from './next-ui';
5+
import HeroUiProvider from './hero-ui';
66
import ThemeProvider from './theme';
77
import Web3Provider from './web3';
88

99
type TRootProvider = PropsWithChildren;
1010

1111
export default function RootProvider({ children }: TRootProvider) {
1212
return (
13-
<NextUiProvider>
13+
<HeroUiProvider>
1414
<ThemeProvider>
1515
<Web3Provider>{children}</Web3Provider>
1616
</ThemeProvider>
17-
</NextUiProvider>
17+
</HeroUiProvider>
1818
);
1919
}

src/components/switch-chain/chains-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from 'react';
44

55
import type { Chain } from 'viem';
66

7-
import { Button } from '@nextui-org/button';
7+
import { Button } from '@heroui/button';
88

99
type TChainsList = {
1010
title: string;

src/components/ui/theme-toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useState } from 'react';
44

5-
import { Button } from '@nextui-org/button';
5+
import { Button } from '@heroui/button';
66
import { Laptop, MoonStar, Sun } from 'lucide-react';
77
import { useTheme } from 'next-themes';
88

src/components/wallet/dropdown/commons/dynamic-fallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
import type { PropsWithChildren } from 'react';
44

5-
import { Skeleton } from '@nextui-org/skeleton';
5+
import { Skeleton } from '@heroui/skeleton';
66

77
import { cn } from '@/lib/utils';
88

src/components/wallet/dropdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo, useRef, useState } from 'react';
22

3-
import { Button } from '@nextui-org/button';
3+
import { Button } from '@heroui/button';
44
import dynamic from 'next/dynamic';
55
import { useAccount } from 'wagmi';
66

src/components/wallet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React from 'react';
66

77
import type { ComponentProps } from 'react';
88

9-
import { Button } from '@nextui-org/button';
9+
import { Button } from '@heroui/button';
1010
import { useConnectModal } from '@rainbow-me/rainbowkit';
1111
import { useAccount } from 'wagmi';
1212

tailwind.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
import type { Config } from 'tailwindcss';
55

6-
import { nextui } from '@nextui-org/theme';
6+
import { heroui } from '@heroui/theme';
77

88
// based on shadcn's styles
9-
const nextUIStyleOverride = {
9+
const heroUIStyleOverride = {
1010
layout: {
1111
disabledOpacity: '0.5', // shadcn: 0.9
1212
radius: {
@@ -27,7 +27,7 @@ const config = {
2727
darkMode: ['class'],
2828
content: [
2929
'./src/**/*.{ts,tsx}',
30-
'./node_modules/@nextui-org/theme/dist/components/**/*.{js,ts,jsx,tsx}'
30+
'./node_modules/@heroui/theme/dist/components/**/*.{js,ts,jsx,tsx}'
3131
],
3232
theme: {
3333
container: {
@@ -94,7 +94,7 @@ const config = {
9494
}
9595
}
9696
},
97-
plugins: [nextui(nextUIStyleOverride), require('tailwindcss-animate')]
97+
plugins: [heroui(heroUIStyleOverride), require('tailwindcss-animate')]
9898
} satisfies Config;
9999

100100
export default config;

0 commit comments

Comments
 (0)