Skip to content

Commit bbe8478

Browse files
committed
fix lint
1 parent 4e31f94 commit bbe8478

File tree

9 files changed

+79
-65
lines changed

9 files changed

+79
-65
lines changed

apps/example-dapp/biome.jsonc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"root": false,
3-
"$schema": "https://biomejs.dev/schemas/2.2.7/schema.json",
3+
"$schema": "https://biomejs.dev/schemas/2.3.0/schema.json",
44
"extends": ["@macalinao/biome-config/base", "@macalinao/biome-config/react"],
55
"linter": {
66
"domains": {
@@ -41,6 +41,19 @@
4141
}
4242
}
4343
}
44+
},
45+
{
46+
"includes": [
47+
"src/components/ui/sidebar.tsx",
48+
"src/components/theme-provider.tsx"
49+
],
50+
"linter": {
51+
"rules": {
52+
"style": {
53+
"useComponentExportOnlyModules": "off"
54+
}
55+
}
56+
}
4457
}
4558
]
4659
}

apps/example-dapp/src/components/theme-provider.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
import type * as React from "react";
2-
import { createContext, useContext, useEffect, useState } from "react";
3-
4-
type Theme = "dark" | "light" | "system";
2+
import type { Theme } from "~/hooks/use-theme";
3+
import { useEffect, useState } from "react";
54

65
interface ThemeProviderProps {
76
children: React.ReactNode;
87
defaultTheme?: Theme;
98
storageKey?: string;
109
}
1110

12-
interface ThemeProviderState {
13-
theme: Theme;
14-
setTheme: (theme: Theme) => void;
15-
}
16-
17-
const initialState: ThemeProviderState = {
18-
theme: "system",
19-
setTheme: () => null,
20-
};
21-
22-
const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
23-
2411
export const ThemeProvider: React.FC<ThemeProviderProps> = ({
2512
children,
2613
defaultTheme = "system",
@@ -63,9 +50,3 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
6350
</ThemeProviderContext.Provider>
6451
);
6552
};
66-
67-
// eslint-disable-next-line react-refresh/only-export-components
68-
export const useTheme = (): ThemeProviderState => {
69-
const context = useContext(ThemeProviderContext);
70-
return context;
71-
};

apps/example-dapp/src/components/theme-toggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type * as React from "react";
22
import { Moon, Sun } from "lucide-react";
3-
import { useTheme } from "@/components/theme-provider";
43
import { Button } from "@/components/ui/button";
4+
import { useTheme } from "@/hooks/use-theme";
55

66
export const ThemeToggle: React.FC = () => {
77
const { theme, setTheme } = useTheme();
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { cva } from "class-variance-authority";
2+
3+
export const buttonVariants = cva(
4+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
5+
{
6+
variants: {
7+
variant: {
8+
default:
9+
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
10+
destructive:
11+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
12+
outline:
13+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
14+
secondary:
15+
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
16+
ghost:
17+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
18+
link: "text-primary underline-offset-4 hover:underline",
19+
},
20+
size: {
21+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
22+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
23+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
24+
icon: "size-9",
25+
},
26+
},
27+
defaultVariants: {
28+
variant: "default",
29+
size: "default",
30+
},
31+
},
32+
);
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,8 @@
11
import type { VariantProps } from "class-variance-authority";
22
import type * as React from "react";
33
import { Slot } from "@radix-ui/react-slot";
4-
import { cva } from "class-variance-authority";
54
import { cn } from "@/lib/utils";
6-
7-
const buttonVariants = cva(
8-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9-
{
10-
variants: {
11-
variant: {
12-
default:
13-
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
14-
destructive:
15-
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
16-
outline:
17-
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
18-
secondary:
19-
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
20-
ghost:
21-
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22-
link: "text-primary underline-offset-4 hover:underline",
23-
},
24-
size: {
25-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
26-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
27-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
28-
icon: "size-9",
29-
},
30-
},
31-
defaultVariants: {
32-
variant: "default",
33-
size: "default",
34-
},
35-
},
36-
);
5+
import { buttonVariants } from "./button-variants";
376

387
function Button({
398
className,
@@ -56,5 +25,4 @@ function Button({
5625
);
5726
}
5827

59-
// eslint-disable-next-line react-refresh/only-export-components
60-
export { Button, buttonVariants };
28+
export { Button };

apps/example-dapp/src/components/ui/sidebar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
3030
const SIDEBAR_WIDTH_ICON = "3rem";
3131
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
3232

33-
interface SidebarContextProps {
33+
export interface SidebarContextProps {
3434
state: "expanded" | "collapsed";
3535
open: boolean;
3636
setOpen: (open: boolean) => void;
@@ -40,7 +40,10 @@ interface SidebarContextProps {
4040
toggleSidebar: () => void;
4141
}
4242

43-
const SidebarContext = React.createContext<SidebarContextProps | null>(null);
43+
// eslint-disable-next-line react-refresh/only-export-components
44+
export const SidebarContext = React.createContext<SidebarContextProps | null>(
45+
null,
46+
);
4447

4548
function useSidebar() {
4649
const context = React.useContext(SidebarContext);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createContext, useContext } from "react";
2+
3+
export type Theme = "dark" | "light" | "system";
4+
5+
export interface ThemeProviderState {
6+
theme: Theme;
7+
setTheme: (theme: Theme) => void;
8+
}
9+
10+
const initialState: ThemeProviderState = {
11+
theme: "system",
12+
setTheme: () => null,
13+
};
14+
15+
export const ThemeProviderContext =
16+
createContext<ThemeProviderState>(initialState);
17+
18+
export const useTheme = (): ThemeProviderState => {
19+
const context = useContext(ThemeProviderContext);
20+
return context;
21+
};

biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.7/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.0/schema.json",
33
"extends": ["@macalinao/biome-config/base"]
44
}

packages/react-quarry/src/hooks/use-pool-stats.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ export const usePoolStats = (poolInfo: PoolInfo): PoolStats => {
4747
annualRewardsRate,
4848
totalDeposits,
4949
};
50-
}, [
51-
quarryAccount?.data,
52-
poolInfo.primaryRewards.rewardsToken,
53-
poolInfo.stakedToken,
54-
]);
50+
}, [quarryAccount, poolInfo]);
5551

5652
return {
5753
annualRewardsRate: stats.annualRewardsRate,

0 commit comments

Comments
 (0)