Skip to content

Commit

Permalink
feat: refine naming of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Sep 30, 2024
1 parent 3c412f8 commit e483c88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ const TableRowButton = styled(Button)(({ theme }) => ({
}));
const EditUserButton = styled(TableRowButton)(({ theme }) => ({
color: theme.palette.primary.light,
textDecoration: "underline",
boxShadow: "none",
"&:hover": {
boxShadow: "none",
color: theme.palette.primary.dark,
textDecoration: "underline",
},
}));
const RemoveUserButton = styled(TableRowButton)(({ theme }) => ({
Expand All @@ -47,7 +43,7 @@ export const MembersTable = ({
showAddMemberButton,
showEditMemberButton,
}: MembersTableProps) => {
const [showAddModal, setShowAddModal] = useState<boolean>(false);
const [showModal, setShowModal] = useState<boolean>(false);
const [actionType, setActionType] = useState<ActionType>("add");
const [initialValues, setInitialValues] = useState<TeamMember | undefined>();

Expand Down Expand Up @@ -79,7 +75,7 @@ export const MembersTable = ({
onClick={() => {
setActionType("add");
setInitialValues(undefined);
setShowAddModal(true);
setShowModal(true);
}}
>
Add a new editor
Expand All @@ -88,10 +84,10 @@ export const MembersTable = ({
</TableRow>
)}
</Table>
{showAddModal && (
{showModal && (
<SettingsModal
showModal={showAddModal}
setShowModal={setShowAddModal}
showModal={showModal}
setShowModal={setShowModal}
initialValues={initialValues}
actionType={actionType}
/>
Expand Down Expand Up @@ -156,7 +152,7 @@ export const MembersTable = ({
<EditUserButton
onClick={() => {
setActionType("edit");
setShowAddModal(true);
setShowModal(true);
setInitialValues(member);
}}
data-testId={`edit-button-${i}`}
Expand All @@ -172,7 +168,7 @@ export const MembersTable = ({
<RemoveUserButton
onClick={() => {
setActionType("remove");
setShowAddModal(true);
setShowModal(true);
setInitialValues(member);
}}
data-testId={`remove-button-${i}`}
Expand All @@ -191,7 +187,7 @@ export const MembersTable = ({
onClick={() => {
setActionType("add");
setInitialValues(undefined);
setShowAddModal(true);
setShowModal(true);
}}
>
Add a new editor
Expand All @@ -202,10 +198,10 @@ export const MembersTable = ({
</TableBody>
</Table>
</TableContainer>
{showAddModal && (
{showModal && (
<SettingsModal
showModal={showAddModal}
setShowModal={setShowAddModal}
showModal={showModal}
setShowModal={setShowModal}
initialValues={initialValues}
actionType={actionType}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import DialogContent from "@mui/material/DialogContent";
import Typography from "@mui/material/Typography";
import { useToast } from "hooks/useToast";
import { useStore } from "pages/FlowEditor/lib/store";
import React, { useState } from "react";
import React from "react";

import { EditorModalProps } from "../types";
import { optimisticallyUpdateExistingMember } from "./lib/optimisticallyUpdateMembersTable";
Expand Down

0 comments on commit e483c88

Please sign in to comment.