Skip to content

Commit

Permalink
chore: revert to 2 images per row in gallery layout (#3029)
Browse files Browse the repository at this point in the history
  • Loading branch information
nakedfool authored Dec 5, 2024
1 parent d4f1785 commit fdbe5ae
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ const ListProposalsContainer = ({ enabledPreview, children }: ListProposalsConta
case EntryPreview.IMAGE_AND_TITLE:
case EntryPreview.TWEET:
const childrenArray = React.Children.toArray(children);
const firstColumn = childrenArray.filter((_, index) => index % 3 === 0);
const secondColumn = childrenArray.filter((_, index) => index % 3 === 1);
const thirdColumn = childrenArray.filter((_, index) => index % 3 === 2);
const leftColumn = childrenArray.filter((_, index) => index % 2 === 0);
const rightColumn = childrenArray.filter((_, index) => index % 2 !== 0);

if (isMobile) {
return <div className="flex flex-col gap-4">{children}</div>;
Expand All @@ -28,21 +27,14 @@ const ListProposalsContainer = ({ enabledPreview, children }: ListProposalsConta
return (
<div className="flex gap-4">
<div className="flex-1 flex flex-col gap-4">
{firstColumn.map((child, index) => (
{leftColumn.map((child, index) => (
<div key={index} className="break-inside-avoid">
{child}
</div>
))}
</div>
<div className="flex-1 flex flex-col gap-4">
{secondColumn.map((child, index) => (
<div key={index} className="break-inside-avoid">
{child}
</div>
))}
</div>
<div className="flex-1 flex flex-col gap-4">
{thirdColumn.map((child, index) => (
{rightColumn.map((child, index) => (
<div key={index} className="break-inside-avoid">
{child}
</div>
Expand Down

0 comments on commit fdbe5ae

Please sign in to comment.