Skip to content

Commit

Permalink
fix: code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
clmntsnr committed Dec 9, 2024
1 parent 79b0121 commit d13a793
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
export { default as Connected } from "./components/dapp/Connected";
2 changes: 1 addition & 1 deletion src/components/dapp/Connected.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
19 changes: 16 additions & 3 deletions src/components/primitives/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,22 @@ type ListElement = ReactElement<{
size: unknown;
className?: string;
}>;
export type ListProps = Component<Styled<typeof listStyles> & { indexOffset?: number, dividerClassName?: (index: number) => string; }, HTMLDivElement>;
export type ListProps = Component<
Styled<typeof listStyles> & { 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(() => {
Expand Down Expand Up @@ -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 (
<div className={mergeClass(base(), className)} {...props}>
Expand Down
8 changes: 5 additions & 3 deletions src/components/primitives/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -231,8 +231,10 @@ export function Table<T extends Columns>({
}

export function createTable<T extends Columns>(columns: T) {
// biome-ignore lint/suspicious/noExplicitAny: no reasons for it to have type errors
const TemplateTable = (props: Omit<TableProps<T>, "columns"> & ListProps) => <Table {...(props as any)} columns={columns} />;
const TemplateTable = (props: Omit<TableProps<T>, "columns"> & ListProps) => (
// biome-ignore lint/suspicious/noExplicitAny: no reasons for it to have type errors
<Table {...(props as any)} columns={columns} />
);

// biome-ignore lint/suspicious/noExplicitAny: no reasons for it to have type errors
const TemplateRow = (props: Omit<RowProps<T>, "columns">) => <Row {...(props as any)} columns={columns} />;
Expand Down

0 comments on commit d13a793

Please sign in to comment.