Compare commits

...

1 commit

Author SHA1 Message Date
ce3c7598f9
feat(slot blocking): add buttons to sidebar
Some checks failed
container-scan / Container Scan (pull_request) Has been cancelled
docker-build / docker (pull_request) Has been cancelled
tests / Tests (pull_request) Has been cancelled
2025-07-01 00:08:32 +02:00
7 changed files with 31 additions and 20 deletions

View file

@ -22,7 +22,7 @@ export default function BlockedSlots() {
<div className='relative h-full flex flex-col items-center'> <div className='relative h-full flex flex-col items-center'>
{/* Heading */} {/* Heading */}
<h1 className='text-3xl font-bold mt-8 mb-4 text-center z-10'> <h1 className='text-3xl font-bold mt-8 mb-4 text-center z-10'>
My Blocked Slots My Blockers
</h1> </h1>
{/* Scrollable blocked slot list */} {/* Scrollable blocked slot list */}
@ -40,11 +40,11 @@ export default function BlockedSlots() {
) : ( ) : (
<div className='flex flex-1 flex-col items-center justify-center min-h-[300px]'> <div className='flex flex-1 flex-col items-center justify-center min-h-[300px]'>
<Label size='large' className='justify-center text-center'> <Label size='large' className='justify-center text-center'>
You don&#39;t have any blocked slots right now You don&#39;t have any blockers 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>

View file

@ -14,7 +14,7 @@ import {
SidebarMenuItem, SidebarMenuItem,
} from '@/components/custom-ui/sidebar'; } from '@/components/custom-ui/sidebar';
import { ChevronDown } from 'lucide-react'; import { CalendarMinus, CalendarMinus2, 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'
>
<CalendarMinus2 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>

View file

@ -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'>

View file

@ -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>

View file

@ -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) => (