Skip to content

Commit

Permalink
feat: update table props
Browse files Browse the repository at this point in the history
  • Loading branch information
Rickk137 committed Oct 26, 2023
1 parent a2f90bc commit 0124db5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const LendFrame: FC = () => {
expandedContent={pool => <LendFrameDetails pool={pool} />}
expandedClassNames="border border-gray-70 border-t-0"
preventExpandOnClickClass="prevent-row-click"
rowSubTitle={generateRowSubTitle}
subtitleRenderer={generateRowSubTitle}
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/2_molecules/Table/Table.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export type TableProps<RowType extends RowObject> = {
preventExpandOnClickClass?: string;
mobileRenderer?: (row: RowType) => ReactNode;
hideHeader?: boolean;
rowSubTitle?: (row: RowType) => ReactNode;
subtitleRenderer?: (row: RowType) => ReactNode;
};

export enum OrderDirection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const TableMobile = <RowType extends RowObject>({
className,
expandedContent,
mobileRenderer,
rowSubTitle,
subtitleRenderer,
}: TableProps<RowType>) => (
<div className={classNames(styles.wrapper, className)}>
{rows &&
Expand All @@ -34,7 +34,7 @@ export const TableMobile = <RowType extends RowObject>({
dataAttribute={dataAttribute}
expandedContent={expandedContent}
renderer={mobileRenderer}
subTitle={rowSubTitle?.(row)}
subtitleRenderer={subtitleRenderer}
/>
))}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type TableMobileRowProps<RowType extends RowObject> = {
title: ReactNode;
expandedContent?: (row: RowType) => ReactNode;
renderer?: (row: RowType) => ReactNode;
subTitle?: ReactNode;
subtitleRenderer?: (row: RowType) => ReactNode;
};

export const TableMobileRow = <RowType extends RowObject>({
Expand All @@ -25,7 +25,7 @@ export const TableMobileRow = <RowType extends RowObject>({
title,
expandedContent,
renderer,
subTitle,
subtitleRenderer,
}: TableMobileRowProps<RowType>) => {
const [open, setOpen] = useState(false);

Expand Down Expand Up @@ -63,7 +63,7 @@ export const TableMobileRow = <RowType extends RowObject>({
{renderer && renderer(row)}
</div>
</Accordion>
{!open && subTitle}
{!open && subtitleRenderer && subtitleRenderer(row)}
</>
);
};

0 comments on commit 0124db5

Please sign in to comment.