Redo confirm changes box

This commit is contained in:
Carlos Monastyrski
2025-07-22 11:03:25 -03:00
parent 0c855f3bd4
commit f992535812
@@ -1,6 +1,6 @@
/* eslint-disable jsx-a11y/label-has-associated-control */ /* eslint-disable jsx-a11y/label-has-associated-control */
import React, { useCallback, useState } from "react"; import React, { useCallback, useState } from "react";
import { faCodeCommit, faEye, faFolder, faKey, faTrash } from "@fortawesome/free-solid-svg-icons"; import { faCodeCommit, faEye, faFolder, faKey } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Badge, Button, Input, Modal, ModalContent } from "@app/components/v2"; import { Badge, Button, Input, Modal, ModalContent } from "@app/components/v2";
@@ -296,41 +296,48 @@ export const CommitForm: React.FC<CommitFormProps> = ({
<> <>
{/* Floating Panel */} {/* Floating Panel */}
{!isModalOpen && ( {!isModalOpen && (
<div className="fixed bottom-4 z-40 w-64 self-center rounded-lg border border-mineshaft-600 bg-mineshaft-800 shadow-2xl"> <div className="fixed bottom-4 z-40 w-full max-w-4xl self-center rounded-lg border border-mineshaft-600 bg-mineshaft-800 shadow-2xl">
<div className="flex w-full justify-center border-b border-mineshaft-600 p-2"> <div className="flex items-center justify-between p-4">
<div className="flex w-full items-center justify-between"> {/* Left Content */}
<div className="flex items-center gap-2"> <div className="flex-1">
<FontAwesomeIcon icon={faCodeCommit} className="text-mineshaft-400" /> {/* Header */}
<div className="mb-2 flex items-center gap-2">
<div className="h-2 w-2 rounded-full bg-yellow-500" />
<span className="font-medium text-mineshaft-100">Pending Changes</span> <span className="font-medium text-mineshaft-100">Pending Changes</span>
</div>
<Badge variant="primary" className="text-xs"> <Badge variant="primary" className="text-xs">
{totalChangesCount} Change{totalChangesCount !== 1 ? "s" : ""} {totalChangesCount} Change{totalChangesCount !== 1 ? "s" : ""}
</Badge> </Badge>
</div> </div>
{/* Description */}
<p className="text-sm text-mineshaft-400">
Review your pending changes and commit them to apply the updates.
</p>
</div> </div>
<div className="flex justify-center gap-2 p-2"> {/* Right Buttons */}
<div className="ml-6 flex gap-3">
<Button <Button
size="sm" size="sm"
leftIcon={<FontAwesomeIcon icon={faTrash} />}
onClick={() => clearAllPendingChanges({ workspaceId, environment, secretPath })} onClick={() => clearAllPendingChanges({ workspaceId, environment, secretPath })}
isDisabled={totalChangesCount === 0} isDisabled={totalChangesCount === 0}
variant="outline_bg" variant="outline_bg"
className="h-8 flex-1 hover:border-red/40 hover:bg-red/[0.1]" className="px-4 hover:border-red/40 hover:bg-red/[0.1]"
> >
Discard Discard
</Button> </Button>
<Button <Button
variant="outline_bg" variant="solid"
leftIcon={<FontAwesomeIcon icon={faEye} />} leftIcon={<FontAwesomeIcon icon={faEye} />}
onClick={() => setIsModalOpen(true)} onClick={() => setIsModalOpen(true)}
isDisabled={totalChangesCount === 0} isDisabled={totalChangesCount === 0}
className="h-8 flex-1" className="px-6"
> >
Review Review Changes
</Button> </Button>
</div> </div>
</div> </div>
</div>
)} )}
{/* Commit Modal */} {/* Commit Modal */}