Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

replace companies with task list

Jean-Baptiste Kaiser89ed1d2f8785
diff --git a/registry.json b/registry.json
index 19661bca..bde82506 100644
--- a/registry.json
+++ b/registry.json
@@ -44,6 +44,10 @@
"path": "src/components/atomic-crm/tasks/Task.tsx",
"type": "registry:component"
},
+ {
+ "path": "src/components/atomic-crm/tasks/MobileTasksList.tsx",
+ "type": "registry:component"
+ },
{
"path": "src/components/atomic-crm/tasks/AddTask.tsx",
"type": "registry:component"
diff --git a/src/components/atomic-crm/dashboard/TasksList.tsx b/src/components/atomic-crm/dashboard/TasksList.tsx
index 5fc82efe..b79cc5ef 100644
--- a/src/components/atomic-crm/dashboard/TasksList.tsx
+++ b/src/components/atomic-crm/dashboard/TasksList.tsx
@@ -53,17 +53,23 @@ export const TasksList = () => {
<AddTask display="icon" selectContact />
</div>
<Card className="p-4 mb-2">
- <div className="flex flex-col gap-4">
- <TasksListEmpty />
- <TasksListFilter title="Overdue" filter={taskFilters.overdue} />
- <TasksListFilter title="Today" filter={taskFilters.today} />
- <TasksListFilter title="Tomorrow" filter={taskFilters.tomorrow} />
- {isBeforeFriday && (
- <TasksListFilter title="This week" filter={taskFilters.thisWeek} />
- )}
- <TasksListFilter title="Later" filter={taskFilters.later} />
- </div>
+ <TasksListContent />
</Card>
</div>
);
};
+
+export const TasksListContent = () => {
+ return (
+ <div className="flex flex-col gap-4">
+ <TasksListEmpty />
+ <TasksListFilter title="Overdue" filter={taskFilters.overdue} />
+ <TasksListFilter title="Today" filter={taskFilters.today} />
+ <TasksListFilter title="Tomorrow" filter={taskFilters.tomorrow} />
+ {isBeforeFriday && (
+ <TasksListFilter title="This week" filter={taskFilters.thisWeek} />
+ )}
+ <TasksListFilter title="Later" filter={taskFilters.later} />
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/src/components/atomic-crm/layout/MobileContent.tsx b/src/components/atomic-crm/layout/MobileContent.tsx
index ca40c2d9..b5a5fc57 100644
--- a/src/components/atomic-crm/layout/MobileContent.tsx
+++ b/src/components/atomic-crm/layout/MobileContent.tsx
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
export const MobileContent = ({ children }: { children: ReactNode }) => (
<main
- className="max-w-screen-xl mx-auto pt-18 px-4 pb-18 min-h-screen overflow-y-auto"
+ className="max-w-screen-xl mx-auto pt-18 px-4 pb-20 min-h-screen overflow-y-auto"
id="main-content"
>
{children}
diff --git a/src/components/atomic-crm/layout/MobileNavigation.tsx b/src/components/atomic-crm/layout/MobileNavigation.tsx
index 736b149a..8cad0089 100644
--- a/src/components/atomic-crm/layout/MobileNavigation.tsx
+++ b/src/components/atomic-crm/layout/MobileNavigation.tsx
@@ -11,7 +11,7 @@ import {
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { cn } from "@/lib/utils";
import {
- Building2,
+ ListTodo,
Home,
LogOut,
Moon,
@@ -42,6 +42,8 @@ export const MobileNavigation = () => {
currentPath = "/contacts";
} else if (matchPath("/companies/*", location.pathname)) {
currentPath = "/companies";
+ } else if (matchPath("/tasks/*", location.pathname)) {
+ currentPath = "/tasks";
} else if (matchPath("/deals/*", location.pathname)) {
currentPath = "/deals";
} else {
@@ -69,10 +71,10 @@ export const MobileNavigation = () => {
/>
<CreateButton />
<NavigationButton
- href="/companies"
- Icon={Building2}
- label="Companies"
- isActive={currentPath === "/companies"}
+ href="/tasks"
+ Icon={ListTodo}
+ label="Tasks"
+ isActive={currentPath === "/tasks"}
/>
<SettingsButton />
</>
diff --git a/src/components/atomic-crm/root/CRM.tsx b/src/components/atomic-crm/root/CRM.tsx
index b6989be5..571b5032 100644
--- a/src/components/atomic-crm/root/CRM.tsx
+++ b/src/components/atomic-crm/root/CRM.tsx
@@ -44,6 +44,7 @@ import {
import { i18nProvider } from "./i18nProvider";
import { StartPage } from "../login/StartPage.tsx";
import { useIsMobile } from "@/hooks/use-mobile.ts";
+import { MobileTasksList } from "../tasks/MobileTasksList.tsx";
export type CRMProps = {
dataProvider?: DataProvider;
@@ -219,7 +220,7 @@ const MobileAdmin = (props: CoreAdminProps) => {
<Resource name="companies" {...companies} />
<Resource name="contactNotes" />
<Resource name="dealNotes" />
- <Resource name="tasks" />
+ <Resource name="tasks" list={MobileTasksList} />
<Resource name="sales" {...sales} />
<Resource name="tags" />
</Admin>
diff --git a/src/components/atomic-crm/tasks/MobileTasksList.tsx b/src/components/atomic-crm/tasks/MobileTasksList.tsx
new file mode 100644
index 00000000..f934c7a4
--- /dev/null
+++ b/src/components/atomic-crm/tasks/MobileTasksList.tsx
@@ -0,0 +1,14 @@
+import { TasksListContent } from "../dashboard/TasksList";
+import { MobileContent } from "../layout/MobileContent";
+import MobileHeader from "../layout/MobileHeader";
+
+export const MobileTasksList = () => (
+ <>
+ <MobileHeader>
+ <h1 className="text-xl font-semibold">Tasks</h1>
+ </MobileHeader>
+ <MobileContent>
+ <TasksListContent />
+ </MobileContent>
+ </>
+);