Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: consoles removed | todolist _id title | layout top spacing #8

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/(private)/notes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export default function NotesPage() {
isPinned: _note.isPinned,
});
if (formValuesString !== noteString) {
console.log(formValuesString, noteString);
await updateNote(note);
}
} else {
Expand Down
9 changes: 7 additions & 2 deletions app/(private)/todos/[_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const TodosPage = ({ params }: { params: { _id: string } }) => {
collapsed: { mobile: !form.values._id, desktop: !form.values._id },
}}
>
<AppShell.Main p={0}>
<AppShell.Main p={0} mt={rem(-100)} pt={rem(80)}>
<Container size="sm">
<TodoPageActions
getTodoLists={getTodoLists}
Expand All @@ -112,7 +112,12 @@ const TodosPage = ({ params }: { params: { _id: string } }) => {
) : (
<Stack>
{data?.map((todo: TodoType) => (
<Todo setSelected={setSelected} refetch={refetch} todo={todo} />
<Todo
key={String(todo._id)}
setSelected={setSelected}
refetch={refetch}
todo={todo}
/>
))}
</Stack>
)}
Expand Down
9 changes: 7 additions & 2 deletions app/(private)/todos/important/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,20 @@ const TodosPage = () => {
collapsed: { mobile: !form.values._id, desktop: !form.values._id },
}}
>
<AppShell.Main p={0}>
<AppShell.Main p={0} mt={rem(-100)} pt={rem(80)}>
<Container size="sm">
<TodoPageActions getTodoLists={getTodoLists} todoList={todoList} refetch={refetch} />
{loading ? (
<TodoSkelton />
) : (
<Stack>
{data?.map((todo: TodoType) => (
<Todo setSelected={setSelected} refetch={refetch} todo={todo} />
<Todo
key={String(todo._id)}
setSelected={setSelected}
refetch={refetch}
todo={todo}
/>
))}
</Stack>
)}
Expand Down
9 changes: 0 additions & 9 deletions app/(private)/todos/layout.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion app/(private)/todos/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const TodosPage = () => {
collapsed: { mobile: !form.values._id, desktop: !form.values._id },
}}
>
<AppShell.Main p={0}>
<AppShell.Main p={0} mt={rem(-100)} pt={rem(80)}>
<Container size="sm">
<TodoPageActions getTodoLists={getTodoLists} todoList={todoList} refetch={refetch} />
{loading ? (
Expand Down
9 changes: 7 additions & 2 deletions app/(private)/todos/recent/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,20 @@ const TodosPage = () => {
collapsed: { mobile: !form.values._id, desktop: !form.values._id },
}}
>
<AppShell.Main p={0}>
<AppShell.Main p={0} mt={rem(-100)} pt={rem(80)}>
<Container size="sm">
<TodoPageActions getTodoLists={getTodoLists} todoList={todoList} refetch={refetch} />
{loading ? (
<TodoSkelton />
) : (
<Stack>
{data?.map((todo: TodoType) => (
<Todo setSelected={setSelected} refetch={refetch} todo={todo} />
<Todo
key={String(todo._id)}
setSelected={setSelected}
refetch={refetch}
todo={todo}
/>
))}
</Stack>
)}
Expand Down
9 changes: 7 additions & 2 deletions app/(private)/todos/today/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,20 @@ const TodosPage = () => {
collapsed: { mobile: !form.values._id, desktop: !form.values._id },
}}
>
<AppShell.Main p={0}>
<AppShell.Main p={0} mt={rem(-100)} pt={rem(80)}>
<Container size="sm">
<TodoPageActions getTodoLists={getTodoLists} todoList={todoList} refetch={refetch} />
{loading ? (
<TodoSkelton />
) : (
<Stack>
{data?.map((todo: TodoType) => (
<Todo setSelected={setSelected} refetch={refetch} todo={todo} />
<Todo
key={String(todo._id)}
setSelected={setSelected}
refetch={refetch}
todo={todo}
/>
))}
</Stack>
)}
Expand Down
9 changes: 7 additions & 2 deletions app/(private)/todos/upcoming/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,20 @@ const TodosPage = () => {
collapsed: { mobile: !form.values._id, desktop: !form.values._id },
}}
>
<AppShell.Main p={0}>
<AppShell.Main p={0} mt={rem(-100)} pt={rem(80)}>
<Container size="sm">
<TodoPageActions getTodoLists={getTodoLists} todoList={todoList} refetch={refetch} />
{loading ? (
<TodoSkelton />
) : (
<Stack>
{data?.map((todo: TodoType) => (
<Todo setSelected={setSelected} refetch={refetch} todo={todo} />
<Todo
key={String(todo._id)}
setSelected={setSelected}
refetch={refetch}
todo={todo}
/>
))}
</Stack>
)}
Expand Down
2 changes: 1 addition & 1 deletion components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<Stack gap={0} my="xs">
{APP?.sidebar?.map((item) => (
<Button
key={item?.label}
key={item?.path}
justify="left"
onClick={() => navigateTo(item?.path)}
leftSection={item?.icon || <IconList />}
Expand Down
2 changes: 1 addition & 1 deletion components/Todo/TodoPageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const TodoPageActions = ({ refetch, getTodoLists, todoList, isListPage = false }
return (
<Group mt="sm" mb="xl" justify="space-between">
<Text c={selected?.color} tt="capitalize" fw={700}>
{selected?.title}
{isListPage ? selected?.title : pathname.split('/')[2]}
</Text>
<Group gap={rem(6)} justify="right">
<ActionIcon variant="subtle" color="gray" onClick={() => window.print()} title="Print">
Expand Down
2 changes: 0 additions & 2 deletions lib/client_functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export const updateTodo = async (_id: string, data: any) => {
};

export const apiCall = async (url: string, body?: any, method: string = 'GET') => {
console.log(url, body, method);

let res;
nprogress.start();
try {
Expand Down
Loading