improvement: make commit popover animated

This commit is contained in:
Scott Wilson
2025-08-13 17:48:44 -07:00
parent b0d24de008
commit 106833328b
@@ -8,6 +8,7 @@ import {
faSave faSave
} from "@fortawesome/free-solid-svg-icons"; } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { AnimatePresence, motion } from "framer-motion";
import { Badge, Button, Input, Modal, ModalContent } from "@app/components/v2"; import { Badge, Button, Input, Modal, ModalContent } from "@app/components/v2";
import { PendingAction } from "@app/hooks/api/secretFolders/types"; import { PendingAction } from "@app/hooks/api/secretFolders/types";
@@ -302,7 +303,16 @@ export const CommitForm: React.FC<CommitFormProps> = ({
<> <>
{/* Floating Panel */} {/* Floating Panel */}
{!isModalOpen && ( {!isModalOpen && (
<div className="fixed bottom-4 left-1/2 z-40 w-full max-w-3xl -translate-x-1/2 self-center rounded-lg border border-yellow/30 bg-mineshaft-800 shadow-2xl lg:left-auto lg:translate-x-0"> <div className="fixed bottom-4 left-1/2 z-40 w-full max-w-3xl -translate-x-1/2 self-center lg:left-auto lg:translate-x-0">
<AnimatePresence mode="wait">
<motion.div
key="select-type-step"
transition={{ duration: 0.3 }}
initial={{ opacity: 0, translateY: 30 }}
animate={{ opacity: 1, translateY: 0 }}
exit={{ opacity: 0, translateY: -30 }}
>
<div className="rounded-lg border border-yellow/30 bg-mineshaft-800 shadow-2xl">
<div className="flex items-center justify-between p-4"> <div className="flex items-center justify-between p-4">
{/* Left Content */} {/* Left Content */}
<div className="flex-1"> <div className="flex-1">
@@ -325,7 +335,9 @@ export const CommitForm: React.FC<CommitFormProps> = ({
<div className="ml-6 mt-0.5 flex items-center gap-3"> <div className="ml-6 mt-0.5 flex items-center gap-3">
<Button <Button
size="sm" size="sm"
onClick={() => clearAllPendingChanges({ workspaceId, environment, secretPath })} onClick={() =>
clearAllPendingChanges({ workspaceId, environment, secretPath })
}
isDisabled={totalChangesCount === 0} isDisabled={totalChangesCount === 0}
variant="outline_bg" variant="outline_bg"
className="px-4 hover:border-red/40 hover:bg-red/[0.1]" className="px-4 hover:border-red/40 hover:bg-red/[0.1]"
@@ -344,6 +356,9 @@ export const CommitForm: React.FC<CommitFormProps> = ({
</div> </div>
</div> </div>
</div> </div>
</motion.div>
</AnimatePresence>
</div>
)} )}
{/* Commit Modal */} {/* Commit Modal */}