feat(slot blocking): add buttons to sidebar
This commit is contained in:
parent
016b4371c2
commit
74be711d2b
7 changed files with 29 additions and 18 deletions
|
@ -43,8 +43,8 @@ export default function BlockedSlots() {
|
||||||
You don't have any blocked slots right now
|
You don't have any blocked slots right now
|
||||||
</Label>
|
</Label>
|
||||||
<RedirectButton
|
<RedirectButton
|
||||||
redirectUrl='/blocked_slots/new'
|
redirectUrl='/blocker/new'
|
||||||
buttonText='create Blocked Slot'
|
buttonText='Create New Blocker'
|
||||||
className='mt-4'
|
className='mt-4'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
|
@ -14,7 +14,7 @@ import {
|
||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
} from '@/components/custom-ui/sidebar';
|
} from '@/components/custom-ui/sidebar';
|
||||||
|
|
||||||
import { ChevronDown } from 'lucide-react';
|
import { CalendarMinus, ChevronDown } from 'lucide-react';
|
||||||
import {
|
import {
|
||||||
Collapsible,
|
Collapsible,
|
||||||
CollapsibleContent,
|
CollapsibleContent,
|
||||||
|
@ -28,8 +28,8 @@ import Link from 'next/link';
|
||||||
import {
|
import {
|
||||||
Star,
|
Star,
|
||||||
CalendarDays,
|
CalendarDays,
|
||||||
User,
|
//User,
|
||||||
Users,
|
//Users,
|
||||||
CalendarClock,
|
CalendarClock,
|
||||||
CalendarPlus,
|
CalendarPlus,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
@ -40,7 +40,7 @@ const items = [
|
||||||
url: '/home',
|
url: '/home',
|
||||||
icon: CalendarDays,
|
icon: CalendarDays,
|
||||||
},
|
},
|
||||||
{
|
/*{
|
||||||
title: 'Friends',
|
title: 'Friends',
|
||||||
url: '#',
|
url: '#',
|
||||||
icon: User,
|
icon: User,
|
||||||
|
@ -49,12 +49,17 @@ const items = [
|
||||||
title: 'Groups',
|
title: 'Groups',
|
||||||
url: '#',
|
url: '#',
|
||||||
icon: Users,
|
icon: Users,
|
||||||
},
|
},*/
|
||||||
{
|
{
|
||||||
title: 'Events',
|
title: 'Events',
|
||||||
url: '/events',
|
url: '/events',
|
||||||
icon: CalendarClock,
|
icon: CalendarClock,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Blockers',
|
||||||
|
url: '/blocker',
|
||||||
|
icon: CalendarMinus,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export function AppSidebar() {
|
export function AppSidebar() {
|
||||||
|
@ -123,6 +128,17 @@ export function AppSidebar() {
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
|
<SidebarMenuItem className='pl-[8px]'>
|
||||||
|
<Link
|
||||||
|
href='/blocker/new'
|
||||||
|
className='flex items-center gap-2 text-xl font-label'
|
||||||
|
>
|
||||||
|
<CalendarPlus className='size-8' />
|
||||||
|
<span className='group-data-[collapsible=icon]:hidden text-nowrap whitespace-nowrap'>
|
||||||
|
New Blocker
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
</SidebarMenuItem>
|
||||||
</SidebarFooter>
|
</SidebarFooter>
|
||||||
</SidebarContent>
|
</SidebarContent>
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default function BlockedSlotListEntry(slot: BlockedSlotListEntryProps) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Link href={`/blocked_slots/${slot.id}`} className='block'>
|
<Link href={`/blocker/${slot.id}`} className='block'>
|
||||||
<Card className='w-full'>
|
<Card className='w-full'>
|
||||||
<div className='grid grid-cols-1 gap-2 mx-auto md:mx-4 md:grid-cols-[80px_1fr_250px]'>
|
<div className='grid grid-cols-1 gap-2 mx-auto md:mx-4 md:grid-cols-[80px_1fr_250px]'>
|
||||||
<div className='w-full items-center justify-center grid'>
|
<div className='w-full items-center justify-center grid'>
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default function BlockedSlotForm({
|
||||||
const { mutateAsync: deleteBlockedSlot } = useDeleteApiBlockedSlotsSlotID({
|
const { mutateAsync: deleteBlockedSlot } = useDeleteApiBlockedSlotsSlotID({
|
||||||
mutation: {
|
mutation: {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
router.push('/blocked_slots');
|
router.push('/blocker');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -80,7 +80,7 @@ export default function BlockedSlotForm({
|
||||||
mutation: {
|
mutation: {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
resetCreate();
|
resetCreate();
|
||||||
router.push('/blocked_slots');
|
router.push('/blocker');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -155,9 +155,7 @@ export default function BlockedSlotForm({
|
||||||
</div>
|
</div>
|
||||||
<div className='items-center ml-auto mr-auto max-sm:mb-6 max-sm:w-full max-sm:flex max-sm:justify-center'>
|
<div className='items-center ml-auto mr-auto max-sm:mb-6 max-sm:w-full max-sm:flex max-sm:justify-center'>
|
||||||
<h1 className='text-center'>
|
<h1 className='text-center'>
|
||||||
{existingBlockedSlotId
|
{existingBlockedSlotId ? 'Update Blocker' : 'Create Blocker'}
|
||||||
? 'Update Blocked Slot'
|
|
||||||
: 'Create Blocked Slot'}
|
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-0 sm:w-[100px]'></div>
|
<div className='w-0 sm:w-[100px]'></div>
|
||||||
|
@ -216,9 +214,7 @@ export default function BlockedSlotForm({
|
||||||
formStateCreate.isSubmitting || formStateUpdate.isSubmitting
|
formStateCreate.isSubmitting || formStateUpdate.isSubmitting
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{existingBlockedSlotId
|
{existingBlockedSlotId ? 'Update Blocker' : 'Create Blocker'}
|
||||||
? 'Update Blocked Slot'
|
|
||||||
: 'Create Blocked Slot'}
|
|
||||||
</Button>
|
</Button>
|
||||||
{existingBlockedSlotId && (
|
{existingBlockedSlotId && (
|
||||||
<Button
|
<Button
|
||||||
|
@ -226,7 +222,7 @@ export default function BlockedSlotForm({
|
||||||
variant='destructive'
|
variant='destructive'
|
||||||
onClick={onDeleteSubmit}
|
onClick={onDeleteSubmit}
|
||||||
>
|
>
|
||||||
Delete Blocked Slot
|
Delete Blocker
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -175,7 +175,6 @@ const EventForm: React.FC<EventFormProps> = (props) => {
|
||||||
console.log('Creating event');
|
console.log('Creating event');
|
||||||
const mutationResult = await createEvent({ data });
|
const mutationResult = await createEvent({ data });
|
||||||
eventID = mutationResult.data.event.id;
|
eventID = mutationResult.data.event.id;
|
||||||
createEvent({ data });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toast.custom((t) => (
|
toast.custom((t) => (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue