+
+
{avatar ? (
-
-
>
From a5ba409a79bf460221000d3e8a1360d3a1a1388b Mon Sep 17 00:00:00 2001
From: Gustavo Nascimento
Date: Thu, 9 May 2024 01:09:49 +0000
Subject: [PATCH 06/23] minor alteration
---
src/components/cat-form/catform.tsx | 86 +++++++++++++++++------------
1 file changed, 52 insertions(+), 34 deletions(-)
diff --git a/src/components/cat-form/catform.tsx b/src/components/cat-form/catform.tsx
index 2396ce4..a430434 100644
--- a/src/components/cat-form/catform.tsx
+++ b/src/components/cat-form/catform.tsx
@@ -1,3 +1,11 @@
+// Todo: Centralizar o input de imagem
+// Todo: Tirar a descrição "Escolha sua imagem" que está dentro do input de imagem
+// Todo: Adicionar o botão para remover a foto do gato e voltar para ao input de seleção de arquivo
+// Todo: Trocar os valores dos selects e adicionar outros caso tenha
+// Todo: Trocar os estilos da bordas dos inputs (Opicional)
+// Todo: Adicionar um loading na escolha da imagem (Opicional)
+
+
import { useState } from "react"
import {
@@ -17,10 +25,11 @@ import {
SelectValue,
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
+import { Button } from "@/components/ui/button";
export function CatForm() {
- const [avatar, setAvatar] = useState < string | null > (null);
+ const [avatar, setAvatar] = useState(null);
const handleAvatarChange = (e: React.ChangeEvent) => {
const file = e.target.files?.[0];
@@ -32,7 +41,7 @@ export function CatForm() {
};
const removeAvatar = () => {
- setAvatar(null); // Remove a imagem
+ setAvatar(null);
};
@@ -43,45 +52,54 @@ export function CatForm() {
Add cat
-
- {avatar ? (
-
-

-
-
- ) : (
+
+ {avatar ? (
+
+

+
+
+ ) : (
+
- )}
+
+ )}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
>
+
+
}
\ No newline at end of file
From f28a4aa17493614275988967c50b13a8d60d31a3 Mon Sep 17 00:00:00 2001
From: Gabriel Collares <98597812+GabrielCollares@users.noreply.github.com>
Date: Fri, 10 May 2024 03:03:07 +0000
Subject: [PATCH 07/23] FIX : adjusted the button and its functions
---
package-lock.json | 1 -
src/components/cat-form/catform.tsx | 11 +++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 03ce989..45889de 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2578,7 +2578,6 @@
}
},
"node_modules/@floating-ui/dom": {
-
"version": "1.6.5",
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.5.tgz",
"integrity": "sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==",
diff --git a/src/components/cat-form/catform.tsx b/src/components/cat-form/catform.tsx
index a430434..c3914ad 100644
--- a/src/components/cat-form/catform.tsx
+++ b/src/components/cat-form/catform.tsx
@@ -26,6 +26,7 @@ import {
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
import { Button } from "@/components/ui/button";
+import { toBeDisabled } from "@testing-library/jest-dom/matchers"
export function CatForm() {
@@ -40,10 +41,14 @@ export function CatForm() {
}
};
+
const removeAvatar = () => {
setAvatar(null);
};
+ const removeSave = (): boolean => {
+ return avatar === null;
+ };
return <>
>
-
-
-}
\ No newline at end of file
+ }
From afe9659065001d7a583b8c0e70970bc4abaadf4b Mon Sep 17 00:00:00 2001
From: Gabriel Collares <98597812+GabrielCollares@users.noreply.github.com>
Date: Fri, 10 May 2024 03:07:16 +0000
Subject: [PATCH 08/23] FIX replacing the tw
---
src/index.css | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 75 insertions(+), 1 deletion(-)
diff --git a/src/index.css b/src/index.css
index bd6213e..6dd80bd 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,3 +1,77 @@
@tailwind base;
@tailwind components;
-@tailwind utilities;
\ No newline at end of file
+@tailwind utilities;
+
+@layer base {
+ :root {
+ --background: 0 0% 100%;
+ --foreground: 222.2 84% 4.9%;
+
+ --card: 0 0% 100%;
+ --card-foreground: 222.2 84% 4.9%;
+
+ --popover: 0 0% 100%;
+ --popover-foreground: 222.2 84% 4.9%;
+
+ --primary: 222.2 47.4% 11.2%;
+ --primary-foreground: 210 40% 98%;
+
+ --secondary: 210 40% 96.1%;
+ --secondary-foreground: 222.2 47.4% 11.2%;
+
+ --muted: 210 40% 96.1%;
+ --muted-foreground: 215.4 16.3% 46.9%;
+
+ --accent: 210 40% 96.1%;
+ --accent-foreground: 222.2 47.4% 11.2%;
+
+ --destructive: 0 84.2% 60.2%;
+ --destructive-foreground: 210 40% 98%;
+
+ --border: 214.3 31.8% 91.4%;
+ --input: 214.3 31.8% 91.4%;
+ --ring: 222.2 84% 4.9%;
+
+ --radius: 0.5rem;
+ }
+
+ .dark {
+ --background: 222.2 84% 4.9%;
+ --foreground: 210 40% 98%;
+
+ --card: 222.2 84% 4.9%;
+ --card-foreground: 210 40% 98%;
+
+ --popover: 222.2 84% 4.9%;
+ --popover-foreground: 210 40% 98%;
+
+ --primary: 210 40% 98%;
+ --primary-foreground: 222.2 47.4% 11.2%;
+
+ --secondary: 217.2 32.6% 17.5%;
+ --secondary-foreground: 210 40% 98%;
+
+ --muted: 217.2 32.6% 17.5%;
+ --muted-foreground: 215 20.2% 65.1%;
+
+ --accent: 217.2 32.6% 17.5%;
+ --accent-foreground: 210 40% 98%;
+
+ --destructive: 0 62.8% 30.6%;
+ --destructive-foreground: 210 40% 98%;
+
+ --border: 217.2 32.6% 17.5%;
+ --input: 217.2 32.6% 17.5%;
+ --ring: 212.7 26.8% 83.9%;
+ }
+}
+
+@layer base {
+ * {
+ @apply border-border;
+ }
+
+ body {
+ @apply bg-background text-foreground;
+ }
+}
\ No newline at end of file
From 957a62e6399cae44184bb62b65bcdfe442649ef5 Mon Sep 17 00:00:00 2001
From: Gabriel Collares <98597812+GabrielCollares@users.noreply.github.com>
Date: Fri, 10 May 2024 03:46:17 +0000
Subject: [PATCH 09/23] FIX : adjusted the remove cat photo button
---
src/components/cat-form/catform.tsx | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/components/cat-form/catform.tsx b/src/components/cat-form/catform.tsx
index c3914ad..64d7e89 100644
--- a/src/components/cat-form/catform.tsx
+++ b/src/components/cat-form/catform.tsx
@@ -26,7 +26,7 @@ import {
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
import { Button } from "@/components/ui/button";
-import { toBeDisabled } from "@testing-library/jest-dom/matchers"
+
export function CatForm() {
@@ -47,6 +47,7 @@ export function CatForm() {
};
const removeSave = (): boolean => {
+
return avatar === null;
};
@@ -57,11 +58,10 @@ export function CatForm() {
Add cat
-
+
{avatar ? (
-

-
+
) : (
@@ -75,12 +75,13 @@ export function CatForm() {
/>
)}
+
-
+
-
+
From 92593daade5ec0b828b5ccda330c348ba927f1af Mon Sep 17 00:00:00 2001
From: Gustavo dos Santos Nascimento
<74427958+GustavoSantoz@users.noreply.github.com>
Date: Fri, 10 May 2024 04:40:11 +0000
Subject: [PATCH 10/23] Fix: adjusting minor error on style
---
src/components/cat-form/catform.tsx | 41 +++++++++++++++--------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/src/components/cat-form/catform.tsx b/src/components/cat-form/catform.tsx
index 64d7e89..b4ec187 100644
--- a/src/components/cat-form/catform.tsx
+++ b/src/components/cat-form/catform.tsx
@@ -26,6 +26,7 @@ import {
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
import { Button } from "@/components/ui/button";
+import { ImageIcon } from "lucide-react"
@@ -41,15 +42,14 @@ export function CatForm() {
}
};
-
- const removeAvatar = () => {
- setAvatar(null);
- };
- const removeSave = (): boolean => {
+ const removeAvatar = (): void => {
+ setAvatar(null);
+ };
- return avatar === null;
- };
+ const disableButton = (): boolean => {
+ return avatar === null;
+ };
return <>