added floating button to the pages
This commit is contained in:
parent
83c9a27a96
commit
bd71b0ae3f
@ -3,8 +3,8 @@ import { Modal } from '../components/reusable';
|
|||||||
import { DailyLogsView } from '../components/rv';
|
import { DailyLogsView } from '../components/rv';
|
||||||
import { DailyLogDetail } from '../components/dv';
|
import { DailyLogDetail } from '../components/dv';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button } from '../components/buttons/Button';
|
|
||||||
import { Plus } from 'lucide-react';
|
import { ClipboardList } from 'lucide-react';
|
||||||
import { DynamicForm } from '../components/forms/DynamicForm';
|
import { DynamicForm } from '../components/forms/DynamicForm';
|
||||||
import { DAILY_REPORTS } from '../api/config';
|
import { DAILY_REPORTS } from '../api/config';
|
||||||
import { dailyReportsClient } from '../api/clients';
|
import { dailyReportsClient } from '../api/clients';
|
||||||
@ -27,17 +27,20 @@ export function DailyLogsPage() {
|
|||||||
const id = row.instance_id as number | string | undefined;
|
const id = row.instance_id as number | string | undefined;
|
||||||
if (id != null) navigate(`/daily/${id}`);
|
if (id != null) navigate(`/daily/${id}`);
|
||||||
}}
|
}}
|
||||||
headerActions={
|
|
||||||
<Button size="sm" iconLeft={<Plus size={14} />} onClick={() => { setIsCreating(true); setCreateTitle("Punch In"); }}>
|
|
||||||
Punch In
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
onPunchOutRow={(row) => {
|
onPunchOutRow={(row) => {
|
||||||
setPunchOutInstanceId(row.instance_id as string | number);
|
setPunchOutInstanceId(row.instance_id as string | number);
|
||||||
setPunchOutTitle("Punch Out");
|
setPunchOutTitle("Punch Out");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Global Floating Action Button for Punch In */}
|
||||||
|
<button
|
||||||
|
onClick={() => { setIsCreating(true); setCreateTitle("Punch In"); }}
|
||||||
|
className="fixed bottom-24 right-6 w-[60px] h-[60px] bg-[var(--z-bg-primary-400)] rounded-3xl flex items-center justify-center shadow-[0_4px_12px_rgba(var(--z-bg-primary-400-rgb),0.4)] text-white z-40 hover:opacity-90 transition-transform hover:scale-105 active:scale-95 cursor-pointer"
|
||||||
|
>
|
||||||
|
<ClipboardList size={24} className="text-white" />
|
||||||
|
</button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
open={isCreating}
|
open={isCreating}
|
||||||
onClose={() => setIsCreating(false)}
|
onClose={() => setIsCreating(false)}
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import { Modal } from '../components/reusable';
|
|||||||
import { OrdersView } from '../components/rv';
|
import { OrdersView } from '../components/rv';
|
||||||
import { OrderDetail } from '../components/dv';
|
import { OrderDetail } from '../components/dv';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button } from '../components/buttons/Button';
|
|
||||||
import { Plus } from 'lucide-react';
|
import { ShoppingBag } from 'lucide-react';
|
||||||
import { DynamicForm } from '../components/forms/DynamicForm';
|
import { DynamicForm } from '../components/forms/DynamicForm';
|
||||||
import { ORDER_BOOKING } from '../api/config';
|
import { ORDER_BOOKING } from '../api/config';
|
||||||
import { orderBookingClient } from '../api/clients';
|
import { orderBookingClient } from '../api/clients';
|
||||||
@ -26,13 +26,16 @@ export function OrdersPage() {
|
|||||||
const id = row.instance_id as number | string | undefined;
|
const id = row.instance_id as number | string | undefined;
|
||||||
if (id != null) navigate(`/orders/${id}`);
|
if (id != null) navigate(`/orders/${id}`);
|
||||||
}}
|
}}
|
||||||
headerActions={
|
|
||||||
<Button size="sm" variant={'outline'} iconLeft={<Plus size={14} />} onClick={() => { setIsCreating(true); setCreateTitle("Place Order"); }}>
|
|
||||||
Place Order
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Global Floating Action Button for Place Order */}
|
||||||
|
<button
|
||||||
|
onClick={() => { setIsCreating(true); setCreateTitle("Place Order"); }}
|
||||||
|
className="fixed bottom-24 right-6 w-[60px] h-[60px] bg-[var(--z-bg-primary-400)] rounded-3xl flex items-center justify-center shadow-[0_4px_12px_rgba(var(--z-bg-primary-400-rgb),0.4)] text-white z-40 hover:opacity-90 transition-transform hover:scale-105 active:scale-95 cursor-pointer"
|
||||||
|
>
|
||||||
|
<ShoppingBag size={24} className="text-white" />
|
||||||
|
</button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
open={isCreating}
|
open={isCreating}
|
||||||
onClose={() => setIsCreating(false)}
|
onClose={() => setIsCreating(false)}
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import { useNavigate, useParams } from 'react-router-dom';
|
|||||||
import { Modal } from '../components/reusable';
|
import { Modal } from '../components/reusable';
|
||||||
import { StoresView } from '../components/rv';
|
import { StoresView } from '../components/rv';
|
||||||
import { StoreDetail } from '../components/dv';
|
import { StoreDetail } from '../components/dv';
|
||||||
import { Button } from '../components/buttons/Button';
|
|
||||||
import { Plus } from 'lucide-react';
|
import { Store } from 'lucide-react';
|
||||||
import { DynamicForm } from '../components/forms/DynamicForm';
|
import { DynamicForm } from '../components/forms/DynamicForm';
|
||||||
import { STORE } from '../api/config';
|
import { STORE } from '../api/config';
|
||||||
import { storeClient } from '../api/clients';
|
import { storeClient } from '../api/clients';
|
||||||
@ -27,17 +27,20 @@ export function StoresPage() {
|
|||||||
const id = row.instance_id as number | string | undefined;
|
const id = row.instance_id as number | string | undefined;
|
||||||
if (id != null) navigate(`/stores/${id}`);
|
if (id != null) navigate(`/stores/${id}`);
|
||||||
}}
|
}}
|
||||||
headerActions={
|
|
||||||
<Button size="sm" iconLeft={<Plus size={14} />} onClick={() => { setIsCreating(true); setCreateTitle("Create Store"); }}>
|
|
||||||
Create Store
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
onEditRow={(row) => {
|
onEditRow={(row) => {
|
||||||
setEditingInstanceId(row.instance_id as string | number);
|
setEditingInstanceId(row.instance_id as string | number);
|
||||||
setEditTitle("Edit Store");
|
setEditTitle("Edit Store");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Global Floating Action Button for Create Store */}
|
||||||
|
<button
|
||||||
|
onClick={() => { setIsCreating(true); setCreateTitle("Create Store"); }}
|
||||||
|
className="fixed bottom-24 right-6 w-[60px] h-[60px] bg-[var(--z-bg-primary-400)] rounded-3xl flex items-center justify-center shadow-[0_4px_12px_rgba(var(--z-bg-primary-400-rgb),0.4)] text-white z-40 hover:opacity-90 transition-transform hover:scale-105 active:scale-95 cursor-pointer"
|
||||||
|
>
|
||||||
|
<Store size={24} className="text-white" />
|
||||||
|
</button>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
open={isCreating}
|
open={isCreating}
|
||||||
onClose={() => setIsCreating(false)}
|
onClose={() => setIsCreating(false)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user