feat: bump client-services (accumulated feature work + deploy fixes)
Snapshot of in-progress work across local_backend, manager_dashboard, and waiter_pwa (pricing, chat, fiscal, prep zones, recovery codes, CRM, inventory, permissions), plus the nginx/docker-compose deploy fixes for the Unraid + NPM reverse-proxy setup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import Button from './Button'
|
||||
// </Modal.Footer>
|
||||
// </Modal>
|
||||
|
||||
export default function Modal({ title, onClose, children, maxWidth = 'max-w-sm', className = '' }) {
|
||||
export default function Modal({ title, onClose, children, footer, maxWidth = 'max-w-sm', className = '', tabs = null, activeTab = null, onTabChange = null }) {
|
||||
// Close on Escape
|
||||
useEffect(() => {
|
||||
function handler(e) {
|
||||
@@ -28,10 +28,11 @@ export default function Modal({ title, onClose, children, maxWidth = 'max-w-sm',
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4"
|
||||
onMouseDown={(e) => { if (e.target === e.currentTarget) onClose?.() }}
|
||||
>
|
||||
<div className={`relative w-full ${maxWidth} rounded-xl border border-slate-200 bg-white shadow-xl ${className}`}>
|
||||
<div className={`relative w-full ${maxWidth} rounded-xl border border-slate-200 bg-white shadow-xl flex flex-col ${className}`}
|
||||
style={{ maxHeight: 'calc(100vh - 2rem)' }}>
|
||||
{/* Header */}
|
||||
{title && (
|
||||
<div className="flex items-center justify-between border-b border-slate-100 px-5 py-4">
|
||||
<div className="flex items-center justify-between border-b border-slate-100 px-5 py-4 shrink-0">
|
||||
<h2 className="text-[15px] font-semibold text-slate-900">{title}</h2>
|
||||
{onClose && (
|
||||
<button
|
||||
@@ -44,16 +45,43 @@ export default function Modal({ title, onClose, children, maxWidth = 'max-w-sm',
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Body */}
|
||||
<div className="px-5 py-4 space-y-3 text-[13px] text-slate-700">
|
||||
{/* Tab bar */}
|
||||
{tabs && (
|
||||
<div className="flex border-b border-slate-100 px-5 shrink-0 gap-1">
|
||||
{tabs.map(tab => (
|
||||
<button
|
||||
key={tab.key}
|
||||
type="button"
|
||||
onClick={() => onTabChange?.(tab.key)}
|
||||
className={`px-3 py-2.5 text-[12px] font-medium border-b-2 transition-colors -mb-px ${
|
||||
activeTab === tab.key
|
||||
? 'border-sky-500 text-sky-700'
|
||||
: 'border-transparent text-slate-500 hover:text-slate-700'
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Body — scrollable */}
|
||||
<div className="px-5 py-4 text-[13px] text-slate-700 overflow-y-auto flex-1 min-h-0">
|
||||
{children}
|
||||
</div>
|
||||
|
||||
{/* Footer — fixed outside scroll area when provided via prop */}
|
||||
{footer && (
|
||||
<div className="shrink-0 border-t border-slate-100 px-5 py-3 flex items-center justify-end gap-2">
|
||||
{footer}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// Footer helper — renders a right-aligned row of action buttons
|
||||
// Footer helper — for modals without tabs (renders inline, modal doesn't scroll)
|
||||
function ModalFooter({ children }) {
|
||||
return (
|
||||
<div className="flex items-center justify-end gap-2 border-t border-slate-100 pt-4 mt-2">
|
||||
|
||||
Reference in New Issue
Block a user