From d13a7938d1f08cb152e479ba41a51fe047077bdc Mon Sep 17 00:00:00 2001 From: sheykei Date: Mon, 9 Dec 2024 12:38:10 +0100 Subject: [PATCH] fix: code quality --- src/components.ts | 2 +- src/components/dapp/Connected.tsx | 2 +- src/components/primitives/List.tsx | 19 ++++++++++++++++--- src/components/primitives/Table.tsx | 8 +++++--- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/components.ts b/src/components.ts index fdd409bd..20c5e09c 100644 --- a/src/components.ts +++ b/src/components.ts @@ -60,4 +60,4 @@ export { default as Countdown } from "./components/dapp/Countdown"; export * from "./components/primitives/Bar"; export { default as Bar } from "./components/primitives/Bar"; export * from "./components/dapp/Connected"; -export { default as Connected } from "./components/dapp/Connected"; \ No newline at end of file +export { default as Connected } from "./components/dapp/Connected"; diff --git a/src/components/dapp/Connected.tsx b/src/components/dapp/Connected.tsx index 75510d5a..d1ed8240 100644 --- a/src/components/dapp/Connected.tsx +++ b/src/components/dapp/Connected.tsx @@ -1,4 +1,4 @@ -import { Modal, Button, WalletConnectors, type ButtonProps } from "../.."; +import { Button, type ButtonProps, Modal, WalletConnectors } from "../.."; import { useWalletContext } from "../../context/Wallet.context"; export type ConnectedProps = ButtonProps; diff --git a/src/components/primitives/List.tsx b/src/components/primitives/List.tsx index a234c595..28965a74 100644 --- a/src/components/primitives/List.tsx +++ b/src/components/primitives/List.tsx @@ -115,9 +115,22 @@ type ListElement = ReactElement<{ size: unknown; className?: string; }>; -export type ListProps = Component & { indexOffset?: number, dividerClassName?: (index: number) => string; }, HTMLDivElement>; +export type ListProps = Component< + Styled & { indexOffset?: number; dividerClassName?: (index: number) => string }, + HTMLDivElement +>; -export default function List({ look, size, flex, content, className, children, indexOffset, dividerClassName, ...props }: ListProps) { +export default function List({ + look, + size, + flex, + content, + className, + children, + indexOffset, + dividerClassName, + ...props +}: ListProps) { const { base, item, divider } = listStyles({ look, size, content: size, flex }); const definedChild = useMemo(() => { @@ -147,7 +160,7 @@ export default function List({ look, size, flex, content, className, children, i ] ); }); - }, [children, divider, item, look, size, indexOffset]); + }, [children, divider, item, look, size, indexOffset, dividerClassName]); return (
diff --git a/src/components/primitives/Table.tsx b/src/components/primitives/Table.tsx index 68848ba3..a98e7402 100644 --- a/src/components/primitives/Table.tsx +++ b/src/components/primitives/Table.tsx @@ -6,7 +6,7 @@ import type { Component, Styled } from "../../utils/types"; import Box from "./Box"; import EventBlocker from "./EventBlocker"; import Icon from "./Icon"; -import List, { ListProps } from "./List"; +import List, { type ListProps } from "./List"; import Text from "./Text"; export const tableStyles = tv({ @@ -231,8 +231,10 @@ export function Table({ } export function createTable(columns: T) { - // biome-ignore lint/suspicious/noExplicitAny: no reasons for it to have type errors - const TemplateTable = (props: Omit, "columns"> & ListProps) => ; + const TemplateTable = (props: Omit, "columns"> & ListProps) => ( + // biome-ignore lint/suspicious/noExplicitAny: no reasons for it to have type errors +
+ ); // biome-ignore lint/suspicious/noExplicitAny: no reasons for it to have type errors const TemplateRow = (props: Omit, "columns">) => ;