Skip to content

Commit

Permalink
fix: bottom navigation button should be full width (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Sep 17, 2024
1 parent 77bd17d commit e097823
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/ui/app/src/components/BottomNavigationButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import clsx from "clsx";
import { FC } from "react";
import { BottomNavigationButton } from "./BottomNavigationButton";

Expand All @@ -12,16 +13,22 @@ export const BottomNavigationButtons: FC<BottomNavigationButtonsProps> = ({ prev
return null;
}

const isGridEnabled = (prev != null && next != null) || alwaysShowGrid;

return (
<div
className={
(prev != null && next != null) || alwaysShowGrid
? "not-prose grid gap-6 md:gap-8 lg:gap-12 grid-cols-2"
: "not-prose grid grid-cols-1"
isGridEnabled ? "not-prose grid gap-6 md:gap-8 lg:gap-12 grid-cols-2" : "not-prose grid grid-cols-1"
}
>
{prev != null && <BottomNavigationButton {...prev} dir="prev" />}
{next != null && <BottomNavigationButton {...next} dir="next" className="col-start-2" />}
{next != null && (
<BottomNavigationButton
{...next}
dir="next"
className={clsx(isGridEnabled ? "col-start-2" : undefined, next.className)}
/>
)}
</div>
);
};

0 comments on commit e097823

Please sign in to comment.