improvement: add translation to new components

This commit is contained in:
canove
2021-01-14 21:36:03 -03:00
parent 964ed649d7
commit af56447464
6 changed files with 49 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import Select from "@material-ui/core/Select";
import Chip from "@material-ui/core/Chip";
import toastError from "../../errors/toastError";
import api from "../../services/api";
import { i18n } from "../../translate/i18n";
const useStyles = makeStyles(theme => ({
chips: {
@@ -33,17 +34,17 @@ const QueueSelect = ({ selectedQueueIds, onChange }) => {
})();
}, []);
const handleChange = event => {
onChange(event.target.value);
const handleChange = e => {
onChange(e.target.value);
};
return (
<div style={{ marginTop: 6 }}>
<FormControl fullWidth margin="dense" variant="outlined">
<InputLabel>Filas</InputLabel>
<InputLabel>{i18n.t("queueSelect.inputLabel")}</InputLabel>
<Select
multiple
labelWidth={40}
labelWidth={60}
value={selectedQueueIds}
onChange={handleChange}
MenuProps={{

View File

@@ -175,7 +175,7 @@ const TicketsManager = () => {
color="primary"
onClick={() => setNewTicketModalOpen(true)}
>
Novo
{i18n.t("ticketsManager.buttons.newTicket")}
</Button>
<Can
role={user.profile}

View File

@@ -4,6 +4,7 @@ import MenuItem from "@material-ui/core/MenuItem";
import FormControl from "@material-ui/core/FormControl";
import Select from "@material-ui/core/Select";
import { Checkbox, ListItemText } from "@material-ui/core";
import { i18n } from "../../translate/i18n";
const TicketsQueueSelect = ({
userQueues,
@@ -34,7 +35,7 @@ const TicketsQueueSelect = ({
},
getContentAnchorEl: null,
}}
renderValue={() => "Filas"}
renderValue={() => i18n.t("ticketsQueueSelect.placeholder")}
>
{userQueues?.length > 0 &&
userQueues.map(queue => (