From 5ddb28042c06e957b777c0176bd3b6084b774fbb Mon Sep 17 00:00:00 2001 From: Vinicius Gabriel Machado <vgm18@inf.ufpr.br> Date: Wed, 29 Sep 2021 18:08:08 -0300 Subject: [PATCH] contrast in admin --- .../Components/DataCards/ComplaintsCard.js | 165 +++++++++--------- .../Components/Inputs/CreateInstitution.js | 23 ++- .../Components/Inputs/CreateLanguage.js | 23 ++- .../Components/Inputs/CreateQuestion.js | 23 ++- .../Components/Inputs/CreateRating.js | 23 ++- .../Components/Inputs/CreateRole.js | 23 ++- .../Components/Inputs/EmailInputs.js | 11 +- src/Admin/Pages/Pages/SubPages/Activity.js | 10 +- 8 files changed, 146 insertions(+), 155 deletions(-) diff --git a/src/Admin/Components/Components/DataCards/ComplaintsCard.js b/src/Admin/Components/Components/DataCards/ComplaintsCard.js index 9530abea..9a35bdcd 100644 --- a/src/Admin/Components/Components/DataCards/ComplaintsCard.js +++ b/src/Admin/Components/Components/DataCards/ComplaintsCard.js @@ -47,6 +47,7 @@ import LoadingSpinner from '../../../../Components/LoadingSpinner'; import SnackBar from '../../../../Components/SnackbarComponent'; import { getRequest, postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import { Store } from 'Store' +import StyledButton from '../Button'; //styles const PORTAL_MEC = "https://plataformaintegrada.mec.gov.br/"; @@ -236,9 +237,11 @@ const CollectionCard = () => { <Button style={{ width: "100%", - color: "#FFFAFA", - backgroundColor: "#FFA07A", + color: state.contrast === "" ? "#FFFAFA" : "yellow", + backgroundColor: state.contrast === "" ? "#FFA07A" : "black", fontWeight: "500", + border: state.contrast === "" ? "" : "1px solid white", + textDecoration: state.contrast === "" ? "none" : "underline yellow" }} variant="contained" onClick={() => { @@ -252,9 +255,11 @@ const CollectionCard = () => { <Button style={{ width: "100%", - color: "#FFFAFA", - backgroundColor: "#FA8072", + color: state.contrast === "" ? "#FFFAFA" : "yellow", + backgroundColor: state.contrast === "" ? "#FA8072" : "black", fontWeight: "500", + border: state.contrast === "" ? "" : "1px solid white", + textDecoration: state.contrast === "" ? "none" : "underline yellow" }} variant="contained" onClick={() => { @@ -268,9 +273,11 @@ const CollectionCard = () => { <Button style={{ width: "100%", - color: "#FFFAFA", - backgroundColor: "red", + color: state.contrast === "" ? "#FFFAFA" : "yellow", + backgroundColor: state.contrast === "" ? "red" : "black", fontWeight: "500", + border: state.contrast === "" ? "" : "1px solid white", + textDecoration: state.contrast === "" ? "none" : "underline yellow" }} variant="contained" onClick={() => { @@ -299,20 +306,20 @@ const CollectionCard = () => { </Typography> </Grid> <Grid item> - <Button + <StyledButton style={{ color: "#FFFAFA", backgroundColor: "#FA8072", fontWeight: "500", }} + color="secondary" variant="contained" onClick={() => HandleComplainObj("accept")} - startIcon={ + icon={ <RemoveRoundedIcon style={{ fill: "#FFFAFA" }} /> } - > - Remover - </Button> + text="Remover" + /> </Grid> </Grid> @@ -334,26 +341,26 @@ const CollectionCard = () => { </Typography> </Grid> <Grid item> - <Button + <StyledButton style={{ color: "#FFFAFA", backgroundColor: "#228B22", fontWeight: "500", }} + color="primary" variant="contained" onClick={() => HandleComplainObj("reject")} - startIcon={ + icon={ <RestoreRoundedIcon style={{ fill: "#FFFAFA" }} /> } - > - Ativar - </Button> + text="Ativar" + /> </Grid> </Grid> </> ); default: - return "Essa denúncia já foi avaliado!"; + return "Essa denúncia já foi avaliada!"; } } @@ -363,73 +370,72 @@ const CollectionCard = () => { return ( <CardActions> <Link to={`/admin/user?id=${item.complainable_id}`}> - <Button + <StyledButton variant="contained" color="primary" - startIcon={<VisibilityIcon />} - > - Visualizar usuário - </Button> + icon={<VisibilityIcon />} + text="Visualizar usuário" + /> </Link> - <Button - style={{ - fontWeight: "500", - backgroundColor: "#FA8072" - }} - variant="contained" - startIcon={<LaunchRoundedIcon style={{ fill: "#FFFAFA" }} />} + + <a + style={{ textDecoration: "none", color: "#FFFAFA" }} + target="_blank" + rel="noreferrer" + href={ + PORTAL_MEC + + convertToLink( + item.complainable_type, + item.complainable_id + ) + } > - <a - style={{ textDecoration: "none", color: "#FFFAFA" }} - target="_blank" - rel="noreferrer" - href={ - PORTAL_MEC + - convertToLink( - item.complainable_type, - item.complainable_id - ) - } - > - MEC RED - </a> - </Button> + <StyledButton + style={{ + fontWeight: "500", + backgroundColor: "#FA8072" + }} + variant="contained" + color="secondary" + icon={<LaunchRoundedIcon style={{ fill: "#FFFAFA" }} />} + text="MEC RED" + /> + </a> </CardActions> ) default: return ( <CardActions> - <Button + <StyledButton variant="contained" color="primary" - startIcon={<GetAppRoundedIcon />} + icon={<GetAppRoundedIcon />} onClick={handleClickOpen('paper')} + text="Veja o recurso" + /> + <a + style={{ textDecoration: "none", color: "#FFFAFA" }} + target="_blank" + rel="noreferrer" + href={ + PORTAL_MEC + + convertToLink( + item.complainable_type, + item.complainable_id + ) + } > - Veja o recurso - </Button> - <Button - style={{ - fontWeight: "500", - backgroundColor: "#FA8072" - }} - variant="contained" - startIcon={<LaunchRoundedIcon style={{ fill: "#FFFAFA" }} />} - > - <a - style={{ textDecoration: "none", color: "#FFFAFA" }} - target="_blank" - rel="noreferrer" - href={ - PORTAL_MEC + - convertToLink( - item.complainable_type, - item.complainable_id - ) - } - > - MEC RED - </a> - </Button> + <StyledButton + style={{ + fontWeight: "500", + backgroundColor: "#FA8072" + }} + variant="contained" + color="secondary" + icon={<LaunchRoundedIcon style={{ fill: "#FFFAFA" }} />} + text="MEC RED" + /> + </a> </CardActions> ) } @@ -697,13 +703,12 @@ const CollectionCard = () => { style={{ textDecoration: "none" }} to={`/admin/complaints`} > - <Button - startIcon={<ListRoundedIcon />} + <StyledButton + icon={<ListRoundedIcon />} color="primary" variant="outlined" - > - Listar - </Button> + text="Listar" + /> </Link> </Grid> </Grid> @@ -850,9 +855,11 @@ const CollectionCard = () => { </DialogContentText> </DialogContent> <DialogActions> - <Button onClick={handleClose} color="primary"> - Fechar - </Button> + <StyledButton + color="primary" + onClick={handleClose} + text="Fechar" + /> </DialogActions> </Dialog> </Grid> diff --git a/src/Admin/Components/Components/Inputs/CreateInstitution.js b/src/Admin/Components/Components/Inputs/CreateInstitution.js index 2ff90b68..e3979c65 100644 --- a/src/Admin/Components/Components/Inputs/CreateInstitution.js +++ b/src/Admin/Components/Components/Inputs/CreateInstitution.js @@ -20,7 +20,7 @@ import React, { useState, useContext } from 'react'; //imports material ui componets import CardContent from "@material-ui/core/CardContent"; import CardAction from '@material-ui/core/CardActions'; -import { Typography, Button, Grid } from '@material-ui/core'; +import { Typography, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; @@ -30,6 +30,7 @@ import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConf import { StyledCard } from "../../../Components/Styles/DataCard"; import { Store } from 'Store' import FormInput from "Components/FormInput.js" +import StyledButton from '../Button'; //router import { Link } from 'react-router-dom'; @@ -210,14 +211,13 @@ const CreateInstitution = (props) => { </Grid> <Grid item> <Link style={{ textDecoration: 'none' }} to={'/admin/institutions'}> - <Button + <StyledButton onClick={props.BackToList} - startIcon={<ListRoundedIcon />} + icon={<ListRoundedIcon />} variant='outlined' color='primary' - > - Listar - </Button> + text="Listar" + /> </Link> </Grid> </Grid> @@ -243,19 +243,16 @@ const CreateInstitution = (props) => { </form> </CardContent> <CardAction> - <Button + <StyledButton onClick={() => { onSubmit(); }} variant="contained" color="primary" disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> + icon={isLoading ? null : <AddRoundedIcon />} + text={isLoading ? <CircularProgress size={24} /> : 'Adicionar'} + /> </CardAction> </StyledCard> ); diff --git a/src/Admin/Components/Components/Inputs/CreateLanguage.js b/src/Admin/Components/Components/Inputs/CreateLanguage.js index 45764323..5187839e 100644 --- a/src/Admin/Components/Components/Inputs/CreateLanguage.js +++ b/src/Admin/Components/Components/Inputs/CreateLanguage.js @@ -20,7 +20,7 @@ import React, { useState, useContext } from 'react'; //imports material ui componets import CardContent from "@material-ui/core/CardContent"; import CardAction from '@material-ui/core/CardActions'; -import { Typography, Button, Grid } from '@material-ui/core'; +import { Typography, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; @@ -30,6 +30,7 @@ import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConf import { StyledCard } from "../../../Components/Styles/DataCard"; import { Store } from 'Store' import FormInput from "Components/FormInput.js" +import StyledButton from '../Button'; //router import { Link } from 'react-router-dom'; @@ -187,14 +188,13 @@ const CreateLanguage = (props) => { </Grid> <Grid item> <Link to={'/admin/languages'} style={{ textDecoration: 'none' }}> - <Button + <StyledButton onClick={props.BackToList} - startIcon={<ListRoundedIcon />} + icon={<ListRoundedIcon />} variant='outlined' color='primary' - > - Listar - </Button> + text="Listar" + /> </Link> </Grid> </Grid> @@ -220,19 +220,16 @@ const CreateLanguage = (props) => { </form> </CardContent> <CardAction> - <Button + <StyledButton onClick={() => { onSubmit(); }} variant="contained" color="primary" disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> + icon={isLoading ? null : <AddRoundedIcon />} + text={isLoading ? <CircularProgress size={24} /> : 'Adicionar'} + /> </CardAction> </StyledCard> ) diff --git a/src/Admin/Components/Components/Inputs/CreateQuestion.js b/src/Admin/Components/Components/Inputs/CreateQuestion.js index 6bd5b688..af878216 100644 --- a/src/Admin/Components/Components/Inputs/CreateQuestion.js +++ b/src/Admin/Components/Components/Inputs/CreateQuestion.js @@ -20,7 +20,7 @@ import React, { useState, useContext } from 'react'; //imports material ui componets import CardContent from "@material-ui/core/CardContent"; import CardAction from '@material-ui/core/CardActions'; -import { Typography, TextField, Button, Grid } from '@material-ui/core'; +import { Typography, TextField, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import MenuItem from "@material-ui/core/MenuItem"; @@ -31,6 +31,7 @@ import SnackBar from '../../../../Components/SnackbarComponent'; import { StyledCard } from "../../../Components/Styles/DataCard"; import { Store } from 'Store' import FormInput from "Components/FormInput.js" +import StyledButton from '../Button'; //router import { Link } from 'react-router-dom'; @@ -172,14 +173,13 @@ const CreateQuestion = (props) => { </Grid> <Grid item> <Link to={'/admin/Questions'} style={{ textDecoration: 'none' }}> - <Button + <StyledButton onClick={props.BackToList} - startIcon={<ListRoundedIcon />} + icon={<ListRoundedIcon />} variant='outlined' color='primary' - > - Listar - </Button> + text="Listar" + /> </Link> </Grid> </Grid> @@ -226,19 +226,16 @@ const CreateQuestion = (props) => { </form> </CardContent> <CardAction> - <Button + <StyledButton onClick={() => { onSubmit(); }} variant="contained" color="primary" disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> + icon={isLoading ? null : <AddRoundedIcon />} + text={isLoading ? <CircularProgress size={24} /> : 'Adicionar'} + /> </CardAction> </StyledCard> ); diff --git a/src/Admin/Components/Components/Inputs/CreateRating.js b/src/Admin/Components/Components/Inputs/CreateRating.js index 0b068c76..41384ba1 100644 --- a/src/Admin/Components/Components/Inputs/CreateRating.js +++ b/src/Admin/Components/Components/Inputs/CreateRating.js @@ -20,7 +20,7 @@ import React, { useState, useContext } from 'react'; //imports material ui componets import CardContent from "@material-ui/core/CardContent"; import CardAction from '@material-ui/core/CardActions'; -import { Typography, Button, Grid } from '@material-ui/core'; +import { Typography, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; @@ -29,6 +29,7 @@ import SnackBar from '../../../../Components/SnackbarComponent'; import { StyledCard } from "../../../Components/Styles/DataCard"; import { Store } from 'Store' import FormInput from "Components/FormInput.js" +import StyledButton from '../Button'; //imports services import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' //router @@ -184,14 +185,13 @@ const CreateRating = (props) => { </Grid> <Grid item> <Link to={'/admin/Ratings'} style={{textDecoration: 'none'}}> - <Button + <StyledButton onClick={props.BackToList} - startIcon={<ListRoundedIcon />} + icon={<ListRoundedIcon />} variant='outlined' color='primary' - > - Listar - </Button> + text="Listar" + /> </Link> </Grid> </Grid> @@ -217,19 +217,16 @@ const CreateRating = (props) => { </form> </CardContent> <CardAction> - <Button + <StyledButton onClick={() => { onSubmit(); }} variant="contained" color="primary" disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> + icon={isLoading ? null : <AddRoundedIcon />} + text={isLoading ? <CircularProgress size={24} /> : 'Adicionar'} + /> </CardAction> </StyledCard> ); diff --git a/src/Admin/Components/Components/Inputs/CreateRole.js b/src/Admin/Components/Components/Inputs/CreateRole.js index 8af5f8ad..9018399b 100644 --- a/src/Admin/Components/Components/Inputs/CreateRole.js +++ b/src/Admin/Components/Components/Inputs/CreateRole.js @@ -20,7 +20,7 @@ import React, { useState, useContext } from 'react'; //imports material ui componets import CardContent from "@material-ui/core/CardContent"; import CardAction from '@material-ui/core/CardActions'; -import { Typography, Button, Grid } from '@material-ui/core'; +import { Typography, Grid } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import AddRoundedIcon from '@material-ui/icons/AddRounded'; import ListRoundedIcon from '@material-ui/icons/ListRounded'; @@ -30,6 +30,7 @@ import { postRequest } from '../../../../Components/HelperFunctions/getAxiosConf import { StyledCard } from "../../../Components/Styles/DataCard"; import { Store } from 'Store' import FormInput from "Components/FormInput.js" +import StyledButton from '../Button'; //router import { Link } from 'react-router-dom'; @@ -177,14 +178,13 @@ const CreateRole = (props) => { </Grid> <Grid item> <Link to={'/admin/permissions'} style={{ textDecoration: 'none' }}> - <Button + <StyledButton onClick={props.BackToList} - startIcon={<ListRoundedIcon />} + icon={<ListRoundedIcon />} variant='outlined' color='primary' - > - Listar - </Button> + text="Listar" + /> </Link> </Grid> </Grid> @@ -210,19 +210,16 @@ const CreateRole = (props) => { </form> </CardContent> <CardAction> - <Button + <StyledButton onClick={() => { onSubmit(); }} variant="contained" color="primary" disabled={isLoading} - startIcon={isLoading ? null : <AddRoundedIcon />} - > - { - isLoading ? <CircularProgress size={24} /> : 'Adicionar' - } - </Button> + icon={isLoading ? null : <AddRoundedIcon />} + text={isLoading ? <CircularProgress size={24} /> : 'Adicionar'} + /> </CardAction> </StyledCard> ) diff --git a/src/Admin/Components/Components/Inputs/EmailInputs.js b/src/Admin/Components/Components/Inputs/EmailInputs.js index 5ef59d34..7ea38af2 100644 --- a/src/Admin/Components/Components/Inputs/EmailInputs.js +++ b/src/Admin/Components/Components/Inputs/EmailInputs.js @@ -25,7 +25,6 @@ import FormControlLabel from "@material-ui/core/FormControlLabel"; import CircularProgress from "@material-ui/core/CircularProgress"; import Checkbox from "@material-ui/core/Checkbox"; import SendRoundedIcon from "@material-ui/icons/SendRounded"; -import Button from "@material-ui/core/Button"; import { makeStyles } from '@material-ui/core/styles'; import Chip from '@material-ui/core/Chip'; //imports from local files @@ -35,6 +34,7 @@ import ClassicEditor from "@ckeditor/ckeditor5-build-classic" import { CKEditor } from '@ckeditor/ckeditor5-react'; import { Store } from 'Store' import FormInput from "Components/FormInput.js" +import StyledButton from '../Button'; const useStyles = makeStyles((theme) => ({ root: { @@ -489,17 +489,16 @@ const EmailInputs = (props) => { */} <div style={{ marginTop: 18 }}> - <Button + <StyledButton onClick={() => { submitRequest(); }} variant="contained" disabled={isSending} color="primary" - startIcon={<SendRoundedIcon />} - > - {isSending ? <CircularProgress size={24} /> : "Enviar"} - </Button> + icon={<SendRoundedIcon />} + text={isSending ? <CircularProgress size={24} /> : "Enviar"} + /> </div> </div > ); diff --git a/src/Admin/Pages/Pages/SubPages/Activity.js b/src/Admin/Pages/Pages/SubPages/Activity.js index 0fe5f9c1..3c82a90f 100644 --- a/src/Admin/Pages/Pages/SubPages/Activity.js +++ b/src/Admin/Pages/Pages/SubPages/Activity.js @@ -25,7 +25,7 @@ import { Url } from "../../../Filters" import { getRequest } from '../../../../Components/HelperFunctions/getAxiosConfig' import LoadingSpinner from '../../../../Components/LoadingSpinner' import MobilePageHeader from '../../../Components/Components/MobileComponents/MobilePageHeader' -import PageHeader from '../../../Components/Components/PageHeader' +import PageHeader, { StyledFilter } from '../../../Components/Components/PageHeader' import { StyledLoadMoreButton, StyledDivButton, useStylesCell, useStylesRow } from "./Collections.js"; //imports from material ui import TableBody from "@material-ui/core/TableBody" @@ -203,7 +203,7 @@ const Activity = () => { ]} > {showFilter ? ( - <> + <StyledFilter contrast={state.contrast}> <div style={{ alignSelf: "flex-end" }}> <TextField @@ -224,7 +224,7 @@ const Activity = () => { ))} </TextField> </div> - </> + </StyledFilter> ) : null} </MobilePageHeader> @@ -327,7 +327,7 @@ const Activity = () => { ]} > {showFilter ? ( - <> + <StyledFilter contrast={state.contrast}> <div style={{ alignSelf: "flex-end" }}> <TextField @@ -348,7 +348,7 @@ const Activity = () => { ))} </TextField> </div> - </> + </StyledFilter> ) : null} </PageHeader> -- GitLab