-
+
-
+
-
diff --git a/src/services/todolist-api/todolists/todolists.api.ts b/src/services/todolist-api/todolists/todolists.api.ts
index 2010988..613603e 100644
--- a/src/services/todolist-api/todolists/todolists.api.ts
+++ b/src/services/todolist-api/todolists/todolists.api.ts
@@ -26,7 +26,7 @@ export const TodolistAPI = {
},
)
- return handleError(res.data)
+ return res.data
},
async deleteTodolist({ todolistId }: { todolistId: string }) {
@@ -60,8 +60,11 @@ export const TodolistAPI = {
return res.data
},
- async updateTask({ todolistId, task }: { todolistId: string; task: Task }) {
- const { id, ...rest } = task
+ async updateTask({
+ id,
+ todolistId,
+ ...rest
+ }: Partial
& Required> & { todolistId: string }) {
const res = await todolistApiInstance.patch(
`/todolists/${todolistId}/tasks/${id}`,
rest,
diff --git a/src/services/todolist-api/todolists/todolists.hooks.ts b/src/services/todolist-api/todolists/todolists.hooks.ts
index 91637cc..7f70fef 100644
--- a/src/services/todolist-api/todolists/todolists.hooks.ts
+++ b/src/services/todolist-api/todolists/todolists.hooks.ts
@@ -17,9 +17,8 @@ export const useCreateTodolistMutation = () => {
return useMutation({
mutationFn: TodolistAPI.createTodolist,
- //todo: add onMutate
- onSuccess: async () => {
- await queryClient.invalidateQueries([QUERY_KEYS.TODOLISTS])
+ onSuccess: () => {
+ queryClient.invalidateQueries([QUERY_KEYS.TODOLISTS])
},
})
}
diff --git a/src/styles/globals.css b/src/styles/globals.css
index 831c996..e8e4f13 100644
--- a/src/styles/globals.css
+++ b/src/styles/globals.css
@@ -1,48 +1,72 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
-.loader {
- width: 48px;
- height: 48px;
- border: 3px dotted #000;
- border-style: solid solid dotted dotted;
- border-radius: 50%;
- display: inline-block;
- position: relative;
- box-sizing: border-box;
- animation: rotation 2s linear infinite;
-}
-.loader::after {
- content: "";
- box-sizing: border-box;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
- border: 3px dotted #ff3d00;
- border-style: solid solid dotted;
- width: 24px;
- height: 24px;
- border-radius: 50%;
- animation: rotationBack 1s linear infinite;
- transform-origin: center center;
+
+@layer base {
+ #__next{
+ height: 100%;
+ }
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 240 10% 3.9%;
+ --card: 0 0% 100%;
+ --card-foreground: 240 10% 3.9%;
+ --popover: 0 0% 100%;
+ --popover-foreground: 240 10% 3.9%;
+ --primary: 240 5.9% 10%;
+ --primary-foreground: 0 0% 98%;
+ --secondary: 240 4.8% 95.9%;
+ --secondary-foreground: 240 5.9% 10%;
+ --muted: 240 4.8% 95.9%;
+ --muted-foreground: 240 3.8% 46.1%;
+ --accent: 240 4.8% 95.9%;
+ --accent-foreground: 240 5.9% 10%;
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 240 5.9% 90%;
+ --input: 240 5.9% 90%;
+ --ring: 240 10% 3.9%;
+ --radius: 0.5rem;
+ --chart-1: 12 76% 61%;
+ --chart-2: 173 58% 39%;
+ --chart-3: 197 37% 24%;
+ --chart-4: 43 74% 66%;
+ --chart-5: 27 87% 67%;
+ }
+
+ .dark {
+ --background: 240 10% 3.9%;
+ --foreground: 0 0% 98%;
+ --card: 240 10% 3.9%;
+ --card-foreground: 0 0% 98%;
+ --popover: 240 10% 3.9%;
+ --popover-foreground: 0 0% 98%;
+ --primary: 0 0% 98%;
+ --primary-foreground: 240 5.9% 10%;
+ --secondary: 240 3.7% 15.9%;
+ --secondary-foreground: 0 0% 98%;
+ --muted: 240 3.7% 15.9%;
+ --muted-foreground: 240 5% 64.9%;
+ --accent: 240 3.7% 15.9%;
+ --accent-foreground: 0 0% 98%;
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 0 0% 98%;
+ --border: 240 3.7% 15.9%;
+ --input: 240 3.7% 15.9%;
+ --ring: 240 4.9% 83.9%;
+ --chart-1: 220 70% 50%;
+ --chart-2: 160 60% 45%;
+ --chart-3: 30 80% 55%;
+ --chart-4: 280 65% 60%;
+ --chart-5: 340 75% 55%;
+ }
}
-@keyframes rotation {
- 0% {
- transform: rotate(0deg);
+@layer base {
+ * {
+ @apply border-border;
}
- 100% {
- transform: rotate(360deg);
+ body {
+ @apply bg-background text-foreground;
}
-}
-@keyframes rotationBack {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(-360deg);
- }
-}
+}
\ No newline at end of file
diff --git a/tailwind.config.cjs b/tailwind.config.cjs
deleted file mode 100644
index 54331dc..0000000
--- a/tailwind.config.cjs
+++ /dev/null
@@ -1,8 +0,0 @@
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- content: ["./src/**/*.{js,ts,jsx,tsx}"],
- theme: {
- extend: {},
- },
- plugins: [],
-};
diff --git a/tailwind.config.ts b/tailwind.config.ts
new file mode 100644
index 0000000..84287e8
--- /dev/null
+++ b/tailwind.config.ts
@@ -0,0 +1,80 @@
+import type { Config } from "tailwindcss"
+
+const config = {
+ darkMode: ["class"],
+ content: [
+ './pages/**/*.{ts,tsx}',
+ './components/**/*.{ts,tsx}',
+ './app/**/*.{ts,tsx}',
+ './src/**/*.{ts,tsx}',
+ ],
+ prefix: "",
+ theme: {
+ container: {
+ center: true,
+ padding: "2rem",
+ screens: {
+ "2xl": "1400px",
+ },
+ },
+ extend: {
+ colors: {
+ border: "hsl(var(--border))",
+ input: "hsl(var(--input))",
+ ring: "hsl(var(--ring))",
+ background: "hsl(var(--background))",
+ foreground: "hsl(var(--foreground))",
+ primary: {
+ DEFAULT: "hsl(var(--primary))",
+ foreground: "hsl(var(--primary-foreground))",
+ },
+ secondary: {
+ DEFAULT: "hsl(var(--secondary))",
+ foreground: "hsl(var(--secondary-foreground))",
+ },
+ destructive: {
+ DEFAULT: "hsl(var(--destructive))",
+ foreground: "hsl(var(--destructive-foreground))",
+ },
+ muted: {
+ DEFAULT: "hsl(var(--muted))",
+ foreground: "hsl(var(--muted-foreground))",
+ },
+ accent: {
+ DEFAULT: "hsl(var(--accent))",
+ foreground: "hsl(var(--accent-foreground))",
+ },
+ popover: {
+ DEFAULT: "hsl(var(--popover))",
+ foreground: "hsl(var(--popover-foreground))",
+ },
+ card: {
+ DEFAULT: "hsl(var(--card))",
+ foreground: "hsl(var(--card-foreground))",
+ },
+ },
+ borderRadius: {
+ lg: "var(--radius)",
+ md: "calc(var(--radius) - 2px)",
+ sm: "calc(var(--radius) - 4px)",
+ },
+ keyframes: {
+ "accordion-down": {
+ from: { height: "0" },
+ to: { height: "var(--radix-accordion-content-height)" },
+ },
+ "accordion-up": {
+ from: { height: "var(--radix-accordion-content-height)" },
+ to: { height: "0" },
+ },
+ },
+ animation: {
+ "accordion-down": "accordion-down 0.2s ease-out",
+ "accordion-up": "accordion-up 0.2s ease-out",
+ },
+ },
+ },
+ plugins: [require("tailwindcss-animate")],
+} satisfies Config
+
+export default config
\ No newline at end of file