Skip to content

Commit

Permalink
fix: 🚨 Corrigido erros de linting
Browse files Browse the repository at this point in the history
  • Loading branch information
LiloMarino committed Oct 30, 2024
1 parent 9f906c6 commit 65e4212
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/assets/styles/resultado.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
display: flex;
align-items: center;
justify-content: center;
background: url('../img/pngwing.com.png') no-repeat;
background-size: contain;
margin-top: 20px; /* Adicione um espaço acima do troféu */
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/QuestionCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ import { v4 as uuidv4 } from "uuid";
import { useToast } from "../context/ToastContext";
import { addAlternativa, associateAlternativaToTags } from "../database/alternativa";
import { addPergunta } from "../database/pergunta";
import { Alternativa, FormErrors, Pergunta, Tag } from "../types";
import { Alternativa, FormErrors, Pergunta } from "../types";
import { handleInputChange } from "../utils/formHelpers";
import { AlternativeCreate, AlternativeCreateProps } from "./AlternativeCreate";

interface QuestionCreateProps {
tags: Tag[];
fetchData: () => Promise<void>;
}

export const QuestionCreate: React.FC<QuestionCreateProps> = ({ tags, fetchData }) => {
export const QuestionCreate: React.FC<QuestionCreateProps> = ({ fetchData }) => {
const [alternativaProps, setAlternativaProps] = useState<AlternativeCreateProps[]>([
{
id: uuidv4(),
placeholder: "Opção 1",
eventKey: "0",
tags: [],
onRemove: () => {},
onTextChange: () => {},
onTagChange: () => {},
Expand Down Expand Up @@ -139,7 +137,6 @@ export const QuestionCreate: React.FC<QuestionCreateProps> = ({ tags, fetchData
id: uuidv4(),
placeholder: "Opção 1",
eventKey: "0",
tags: [],
onRemove: () => {},
onTextChange: handleAlternativeTextChange,
onTagChange: handleAlternativeTagChange,
Expand Down Expand Up @@ -194,7 +191,6 @@ export const QuestionCreate: React.FC<QuestionCreateProps> = ({ tags, fetchData
placeholder={alternativa.placeholder}
eventKey={alternativa.eventKey}
onRemove={() => handleRemoveAlternative(alternativa.id)}
tags={tags}
onTextChange={handleAlternativeTextChange}
onTagChange={handleAlternativeTagChange}
onEnter={handleAddAlternative}
Expand Down
2 changes: 0 additions & 2 deletions src/components/QuestionEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export const QuestionEdit: React.FC<QuestionEditProps> = ({ id, tags }) => {
id: alternativa.id_alternativa.toString(),
placeholder: `Opção ${alternativasProps.length + 1}`,
eventKey: alternativa.id_alternativa.toString(),
tags: tags,
onRemove: () => handleRemoveAlternative(alternativa.id_alternativa!.toString()),
onTextChange: handleAlternativaTextChange,
onTagChange: handleAlternativaTagChange,
Expand Down Expand Up @@ -202,7 +201,6 @@ export const QuestionEdit: React.FC<QuestionEditProps> = ({ id, tags }) => {
placeholder={alternativa.placeholder}
eventKey={alternativa.eventKey}
onRemove={() => handleRemoveAlternative(alternativa.id)}
tags={tags}
onTextChange={handleAlternativaTextChange}
onTagChange={handleAlternativaTagChange}
onEnter={handleAddAlternative}
Expand Down
8 changes: 2 additions & 6 deletions src/views/Perguntas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import HintCard from "../components/HintCard";
import { QuestionCreate } from "../components/QuestionCreate";
import { QuestionMasterCard } from "../components/QuestionMasterCard";
import { deletePergunta, getPerguntas } from "../database/pergunta";
import { getTags } from "../database/tag";
import { Pergunta, Tag } from "../types";
import { Pergunta } from "../types";

const Perguntas: React.FC = () => {
const [tags, setTags] = useState<Tag[]>([]);
const [perguntas, setPerguntas] = useState<Pergunta[]>([]);
const [searchTerm, setSearchTerm] = useState("");
const navigate = useNavigate();
Expand All @@ -26,9 +24,7 @@ const Perguntas: React.FC = () => {
};

const fetchData = async () => {
const tagsFromDB = await getTags();
const perguntasFromDB = await getPerguntas();
setTags(tagsFromDB);
setPerguntas(perguntasFromDB);
};

Expand All @@ -47,7 +43,7 @@ const Perguntas: React.FC = () => {
dela, qualificaria a alternativa escolhida com as tags adequadas.
</HintCard>

<QuestionCreate tags={tags} fetchData={fetchData} />
<QuestionCreate fetchData={fetchData} />

<Container className="mt-3">
<Row>
Expand Down

0 comments on commit 65e4212

Please sign in to comment.