mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
chore: code cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import rules from "../../accessRules";
|
||||
import rules from "../../rules";
|
||||
|
||||
const check = (rules, role, action, data) => {
|
||||
const check = (role, action, data) => {
|
||||
const permissions = rules[role];
|
||||
if (!permissions) {
|
||||
// role is not present in the rules
|
||||
@@ -29,7 +29,7 @@ const check = (rules, role, action, data) => {
|
||||
};
|
||||
|
||||
const Can = ({ role, perform, data, yes, no }) =>
|
||||
check(rules, role, perform, data) ? yes() : no();
|
||||
check(role, perform, data) ? yes() : no();
|
||||
|
||||
Can.defaultProps = {
|
||||
yes: () => null,
|
||||
|
||||
@@ -4,10 +4,10 @@ import React, { useState } from "react";
|
||||
import { GithubPicker } from "react-color";
|
||||
|
||||
const ColorPicker = ({ onChange, currentColor, handleClose, open }) => {
|
||||
const [color, setColor] = useState(currentColor);
|
||||
const [selectedColor, setSelectedColor] = useState(currentColor);
|
||||
|
||||
const handleChange = color => {
|
||||
setColor(color.hex);
|
||||
setSelectedColor(color.hex);
|
||||
handleClose();
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ const ColorPicker = ({ onChange, currentColor, handleClose, open }) => {
|
||||
<GithubPicker
|
||||
width={"100%"}
|
||||
triangle="hide"
|
||||
color={color}
|
||||
color={selectedColor}
|
||||
onChange={handleChange}
|
||||
onChangeComplete={color => onChange(color.hex)}
|
||||
/>
|
||||
|
||||
@@ -178,7 +178,7 @@ const WhatsAppModal = ({ open, onClose, whatsAppId }) => {
|
||||
</div>
|
||||
<QueueSelect
|
||||
selectedQueueIds={selectedQueueIds}
|
||||
onChange={values => setSelectedQueueIds(values)}
|
||||
onChange={selectedIds => setSelectedQueueIds(selectedIds)}
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
|
||||
Reference in New Issue
Block a user