-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix: Move action buttons to sticky footer in AddChargeItemsBillingSheet #16099 #16118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ import { ScrollArea } from "@/components/ui/scroll-area"; | |||||||||||||
| import { | ||||||||||||||
| Sheet, | ||||||||||||||
| SheetContent, | ||||||||||||||
| SheetFooter, | ||||||||||||||
| SheetHeader, | ||||||||||||||
| SheetTitle, | ||||||||||||||
| } from "@/components/ui/sheet"; | ||||||||||||||
|
|
@@ -159,7 +160,7 @@ export default function AddChargeItemsBillingSheet({ | |||||||||||||
| <SheetHeader className="px-4 py-4"> | ||||||||||||||
| <SheetTitle>{t("add_charge_items")}</SheetTitle> | ||||||||||||||
| </SheetHeader> | ||||||||||||||
| <ScrollArea className="flex-1 pb-12 px-4 pt-0"> | ||||||||||||||
| <ScrollArea className="flex-1 px-4 pt-0"> | ||||||||||||||
| <div className="mt-4 space-y-4"> | ||||||||||||||
| {selectedItems.length > 0 && ( | ||||||||||||||
| <div className="space-y-2"> | ||||||||||||||
|
|
@@ -171,7 +172,6 @@ export default function AddChargeItemsBillingSheet({ | |||||||||||||
| key={index} | ||||||||||||||
| className="bg-white rounded-lg border p-4 space-y-3" | ||||||||||||||
| > | ||||||||||||||
| {/* Title and Remove Button */} | ||||||||||||||
| <div className="flex items-start justify-between gap-2"> | ||||||||||||||
| <h4 className="font-medium text-base flex-1"> | ||||||||||||||
| {item.charge_item_definition_object.title} | ||||||||||||||
|
|
@@ -186,7 +186,6 @@ export default function AddChargeItemsBillingSheet({ | |||||||||||||
| </Button> | ||||||||||||||
| </div> | ||||||||||||||
|
|
||||||||||||||
| {/* Quantity and Price */} | ||||||||||||||
| <div className="flex flex-wrap gap-4 items-center"> | ||||||||||||||
| <div className="space-y-1"> | ||||||||||||||
| <label className="text-sm text-gray-500"> | ||||||||||||||
|
|
@@ -373,31 +372,31 @@ export default function AddChargeItemsBillingSheet({ | |||||||||||||
| defaultOpen={open} | ||||||||||||||
| /> | ||||||||||||||
| </div> | ||||||||||||||
|
|
||||||||||||||
| <div className="flex justify-end gap-2"> | ||||||||||||||
| <Button | ||||||||||||||
| variant="outline" | ||||||||||||||
| onClick={() => onOpenChange(false)} | ||||||||||||||
| disabled={isPending} | ||||||||||||||
| > | ||||||||||||||
| {t("cancel")} | ||||||||||||||
| <ShortcutBadge actionId="cancel-action" /> | ||||||||||||||
| </Button> | ||||||||||||||
| <Button | ||||||||||||||
| onClick={(e) => { | ||||||||||||||
| e.preventDefault(); | ||||||||||||||
| e.stopPropagation(); | ||||||||||||||
| handleSubmit(); | ||||||||||||||
| }} | ||||||||||||||
| disabled={isPending || selectedItems.length === 0 || disabled} | ||||||||||||||
| className="flex flex-row items-center gap-2 justify-between" | ||||||||||||||
| > | ||||||||||||||
| {t("add_items")} | ||||||||||||||
| {open && <ShortcutBadge actionId="enter-action" />} | ||||||||||||||
| </Button> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </ScrollArea> | ||||||||||||||
| {/* Fixed Footer with Action Buttons */} | ||||||||||||||
| <SheetFooter className="p-4 border-t bg-white sticky bottom-0 flex-row justify-end gap-2"> | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Consider removing
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing dark mode background on footer
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid overriding footer responsiveness and hardcoded background on Line 378.
Proposed fix- <SheetFooter className="p-4 border-t bg-white sticky bottom-0 flex-row justify-end gap-2">
+ <SheetFooter className="sticky bottom-0 border-t bg-background p-4 gap-2">As per coding guidelines, "Use Tailwind's responsive classes and follow mobile-first approach" and "Include high contrast support for visibility in various clinical lighting conditions." 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| <Button | ||||||||||||||
| variant="outline" | ||||||||||||||
| onClick={() => onOpenChange(false)} | ||||||||||||||
| disabled={isPending} | ||||||||||||||
| > | ||||||||||||||
| {t("cancel")} | ||||||||||||||
| <ShortcutBadge actionId="cancel-action" /> | ||||||||||||||
| </Button> | ||||||||||||||
| <Button | ||||||||||||||
| onClick={(e) => { | ||||||||||||||
| e.preventDefault(); | ||||||||||||||
| e.stopPropagation(); | ||||||||||||||
| handleSubmit(); | ||||||||||||||
| }} | ||||||||||||||
| disabled={isPending || selectedItems.length === 0 || disabled} | ||||||||||||||
| className="flex flex-row items-center gap-2" | ||||||||||||||
| > | ||||||||||||||
| {t("add_items")} | ||||||||||||||
| {open && <ShortcutBadge actionId="enter-action" />} | ||||||||||||||
| </Button> | ||||||||||||||
| </SheetFooter> | ||||||||||||||
| </SheetContent> | ||||||||||||||
| </Sheet> | ||||||||||||||
| ); | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double spacing on
smscreens fromgap-2+sm:space-x-2SheetFooterappliessm:space-x-2by default (viacn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)insheet.tsx). Sincetailwind-mergedoes not treatgap-*andspace-x-*as conflicting utilities (they produce different CSS properties), both will be applied simultaneously onsmand larger breakpoints — resulting in ~8px of margin-left fromspace-x-2stacked on top of the 8pxgap-2, giving roughly 16px of total spacing between the two buttons instead of the intended 8px.To fix this, either negate the default
sm:space-x-2or don't addgap-2here and instead rely on the default: