diff --git a/src/Admin/Pages/Pages/SubPages/Activity.js b/src/Admin/Pages/Pages/SubPages/Activity.js index 54c7c9d23b660770fbecf0769eb268f7634b9643..25d622a09195fd25f1d3a2cbe65583b15f6c0e57 100644 --- a/src/Admin/Pages/Pages/SubPages/Activity.js +++ b/src/Admin/Pages/Pages/SubPages/Activity.js @@ -43,6 +43,7 @@ import AllOutIcon from "@material-ui/icons/AllOut"; import { Link } from 'react-router-dom'; import MobileList from "../../../Components/Components/MobileComponents/SimpleList" import styled from "styled-components" +import PageHeader from "../../../Components/Components/PageHeader" let currPage = 0; @@ -280,7 +281,7 @@ const Activity = () => { <div style={{ alignSelf: "flex-end" }}> <TextField - select + select={true} label="Filtro" value={option ? option : ""} onChange={handleChange} @@ -384,49 +385,30 @@ const Activity = () => { }) } /> - - <Paper style={{ padding: "1em" }}> - <Grid container spacing={3} direction="row" alignItems="center"> - <Grid item xs={6}> - <Typography variant="h4">Atividades</Typography> - </Grid> - <Grid - item - xs={6} - > - <Grid container justify="flex-end" spacing={3}> - <Grid item> - <Button - variant="contained" - color="secondary" - disabled={isUpdating} - onClick={() => { - currPage = 0; - UpdateHandler( - Url("activities", "", `${currPage}`, "DESC") - ); - }} - startIcon={<UpdateRoundedIcon />} - > - {isUpdating ? <CircularProgress size={24} /> : "Atualizar"} - </Button> - </Grid> - <Grid item> - <Button - variant="contained" - color="secondary" - onClick={() => { - setShowFilter(!showFilter); - }} - startIcon={<FilterListRoundedIcon />} - > - Filtrar - </Button> - </Grid> - </Grid> - </Grid> - </Grid> - + <PageHeader + title="Atividades" + actions={[ + { + name: "Atualizar", + isLoading: isUpdating, + func: () => { + currPage = 0; + UpdateHandler( + Url("activities", "", `${currPage}`, "DESC") + ); + }, + icon: <UpdateRoundedIcon /> + }, + { + name: "Filtrar", + isLoading: false, + func: () => { + setShowFilter(!showFilter); + }, + icon: <FilterListRoundedIcon /> + } + ]} + > {showFilter ? ( <> <div style={{ height: "1em" }}></div> @@ -451,7 +433,7 @@ const Activity = () => { </div> </> ) : null} - </Paper> + </PageHeader> <div style={{ height: "2em" }}></div>