Skip to content
Snippets Groups Projects
Commit 1d37c24f authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira Committed by Stephanie Briere Americo
Browse files

Issue/41: FIX SearchBar now display a not found message

parent 57f79310
No related branches found
No related tags found
2 merge requests!58Version 1.1,!54Issue #53: Fix password info
......@@ -65,7 +65,7 @@ const useStyles = makeStyles(theme => ({
numberOfAnswers: {
fontSize: 18,
textAlign: "left",
textAlign: "center",
margin: "7px"
}
}));
......
......@@ -9,6 +9,7 @@ import { useHistory } from "react-router-dom";
// Components
import CardForm from "../components/fieldsListForms/CardForm.jsx";
import Tab from "../components/fieldsListForms/Tab.jsx";
import { Typography } from "@material-ui/core";
const useStyles = makeStyles(theme => ({
body: {
marginBottom: "15%"
......@@ -70,9 +71,10 @@ export default function ListForms() {
* @param string - the string value to be searched.
*/
function searching(string) {
console.log(string);
setAuxForms(
[...forms].filter(value => {
return value.title.includes(string);
return value.title.toLowerCase().includes(string.toLowerCase());
})
);
}
......@@ -108,18 +110,26 @@ export default function ListForms() {
<Tab sort={sort} searching={searching} />
<Container>
<Grid className={classes.Forms}>Seus Formulários:</Grid>
<Grid container spacing={3} className={classes.body}>
{auxForms.map(form => (
<Grid item xl={4} lg={4} md={4} sm={6} xs={12} zeroMinWidth>
<CardForm
id={form.id}
title={form.title}
description={form.description}
numberOfAnswers={form.answersNumber}
date={form.date}
/>
<Grid container justify="center" spacing={3} className={classes.body}>
{auxForms.length ? (
auxForms.map(form => (
<Grid item xl={4} lg={4} md={4} sm={6} xs={12} zeroMinWidth>
<CardForm
id={form.id}
title={form.title}
description={form.description}
numberOfAnswers={form.answersNumber}
date={form.date}
/>
</Grid>
))
) : (
<Grid item>
<Typography variant="h4">
Nenhum formulário foi encontrado!
</Typography>
</Grid>
))}
)}
</Grid>
</Container>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment