Skip to content

Commit

Permalink
feat:muktiple select add for task form
Browse files Browse the repository at this point in the history
  • Loading branch information
ademsuslu committed Nov 20, 2024
1 parent 677a009 commit daf65c1
Show file tree
Hide file tree
Showing 10 changed files with 1,338 additions and 51 deletions.
3 changes: 3 additions & 0 deletions app/(dashboard)/bussines/personal/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import DataTablePersonal from "@/components/shared/DataTablePersonal"
import { TaskCreate } from "@/components/shared/forms/task/task-form"

export default async function Employee() {
const response = await fetch(`${'https://crm-backend-production-e80f.up.railway.app/api'}/employees`,{
Expand All @@ -7,5 +8,7 @@ export default async function Employee() {
const data = await response.json()
return <div>
<DataTablePersonal data={data}/>
<TaskCreate />

</div>
}
85 changes: 35 additions & 50 deletions components/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,

SidebarHeader,
SidebarMenu,
SidebarMenuButton,
Expand All @@ -30,7 +30,7 @@ import Link from "next/link"
const data = {
versions: ["1.0.1", "1.1.0-alpha", "2.0.0-beta1"],
navMain: [

{
title: "Home",
url: "/dashboard",
Expand Down Expand Up @@ -93,47 +93,32 @@ const data = {
{
title: "Reminders",
url: "/customer/reminder",
isActive:false
isActive: false
},
{
title: "Create",
url: "/customer/create",
isActive:false
isActive: false
},

],
},
{
title: "Bussines",
url: "/bussines",
items: [
{
title: "Personal",
url: "/bussines/personal",
isActive:false,
},
{
title: "Create tasks",
url: "/bussines/create-task",
isActive:false,
},
// {
// title: "Fast Refresh",
// url: "#",
// },
// {
// title: "Next.js Compiler",
// url: "#",
// },
// {
// title: "Supported Browsers",
// url: "#",
// },
// {
// title: "Turbopack",
// url: "#",
// },
],
{
title: "Personal",
url: "/bussines/personal",
isActive: false,
},
{
title: "Create tasks",
url: "/bussines/create-task",
isActive: false,
},

],
},
{
title: "Opportunity",
Expand Down Expand Up @@ -161,9 +146,9 @@ const data = {
// },
// ],
},
{
title: "Settings",
url: "/settings",
{
title: "Settings",
url: "/settings",
// items: [
// {
// title: "Installation",
Expand All @@ -174,7 +159,7 @@ const data = {
// url: "#",
// },
// ],
},
},
],
}

Expand All @@ -188,7 +173,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
/>
<SearchForm /> */}
<Link href={"/dashboard"}>
<Logo/>
<Logo />
</Link>
</SidebarHeader>
<SidebarContent className="gap-0">
Expand All @@ -206,27 +191,27 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
className="group/label text-sm text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
>
<CollapsibleTrigger>
<Link href={item.url}>
{item.title}
</Link>
<Link href={item.url}>
{item.title}
</Link>
<ChevronRightIcon className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
</CollapsibleTrigger>
</SidebarGroupLabel>
<CollapsibleContent>
<SidebarGroupContent>
<SidebarMenu>
{item?.items?.map((item) => {
return <SidebarMenuItem className="ms-3" key={item.title}>
<SidebarMenuButton asChild isActive={item?.isActive}>
<Link href={item.url} className="flex gap-2">
<RxDotFilled />
{item.title}</Link>
</SidebarMenuButton>
</SidebarMenuItem>

return <SidebarMenuItem title={item.title} className="ms-3" key={item.title}>
<SidebarMenuButton asChild isActive={item?.isActive}>
<Link href={item.url} className="flex gap-2">
<RxDotFilled />
{item.title}</Link>

</SidebarMenuButton>
</SidebarMenuItem>
}
)}
)}
</SidebarMenu>
</SidebarGroupContent>
</CollapsibleContent>
Expand Down
37 changes: 37 additions & 0 deletions components/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {
MoonIcon,
SunMedium,
LucideProps,
Cat,
Dog,
Fish,
Rabbit,
Turtle,
} from "lucide-react";

export const Icons = {
moonIcon: MoonIcon,
sunIcon: SunMedium,
cat: Cat,
dog: Dog,
fish: Fish,
rabbit: Rabbit,
turtle: Turtle,
gitHub: ({ ...props }: LucideProps) => (
<svg
aria-hidden="true"
focusable="false"
data-prefix="fab"
data-icon="github"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 496 512"
{...props}
>
<path
fill="currentColor"
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
></path>
</svg>
),
};
2 changes: 1 addition & 1 deletion components/shared/DataTablePersonal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ const DataTablePersonal: React.FC<DataTablePersonalProps> = ({ data }) => {
</Link>
</Button>
<Button asChild className="inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 border border-input shadow-sm ml-auto " data-state="closed">
<Link href="/personal/create">
<Link href="/bussines/personal/create">
<FaPersonCirclePlus className="w-6 h-6 "/>
Create
</Link>
Expand Down
Loading

0 comments on commit daf65c1

Please sign in to comment.