Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
musayann authored and dmohns committed Nov 12, 2024
1 parent 05c93d2 commit 2effd88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
16 changes: 6 additions & 10 deletions src/components/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,19 @@ const Block = ({ title, description, entries, minifiedHeader, maxColumns }: Prop
() => calculateRowAndColNumber(entries, maxColumns || MAX_COL_SPAN),
[entries]
);

const colSpan = useMemo(() => {
if (columns < MIN_COL_SPAN) return MIN_COL_SPAN;
return columns
}, [entries]);
}, [entries, columns]);

const rowSpan = useMemo(() => {
return rows + 1
}, [rows]);
const rowSpan = rows + 1;

const blockHeight = useMemo(
() => rowSpan,
[rows]
);
const filteredEntries = useFilter(entries);

return (
<div
className={`col-span-${colSpan} row-span-${rowSpan} mx-auto p-8 bg-gray-100 border-2 border-dashed border-gray-400 `}
className={`col-span-${colSpan} row-span-${rowSpan} p-8 bg-gray-100 border-2 border-dashed border-gray-400 `}
>
<Header
title={title}
Expand All @@ -47,7 +43,7 @@ const Block = ({ title, description, entries, minifiedHeader, maxColumns }: Prop
<div className="m-auto">
<CardCanvas
data={filteredEntries}
blockHeight={blockHeight}
blockHeight={rowSpan}
columns={columns}
/>
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/components/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ const Group = ({
<h3 className="text-neutral-500 font-semibold text-center text-5xl mt-20 mb-12">
{data.title != "NO GROUP" && data.title}
</h3>
<div className="flex w-full">
<div
className={`p-4 grid grid-cols-10 grid-flow-dense place-content-center justify-items-center gap-3 text-sm w-full`}
<div
className={`p-4 grid grid-cols-10 grid-flow-row-dense gap-3 text-sm w-full`}
>
{data.blocks.map((block, i) => {
return (
Expand All @@ -32,7 +31,6 @@ const Group = ({
);
})}
</div>
</div>
</>
);
};
Expand Down

0 comments on commit 2effd88

Please sign in to comment.