Skip to content

Commit

Permalink
fix: react component names uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenmate committed Jul 7, 2024
1 parent e0421ed commit 647ee9b
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/components/DiagramEditor/DiagramEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ export default function App(props) {
setRefreshDiagram((prevState) => !prevState);
};

const renderMoveBackAndFrontButtons = () =>
const MoveBackAndFrontButtons = () =>
selected && (
<React.Fragment>
<button
Expand All @@ -624,7 +624,7 @@ export default function App(props) {
</React.Fragment>
);

const renderAddAttribute = () => {
const AddAttributeButton = () => {
if (selected?.style?.includes("shape=rectangle")) {
return (
<button
Expand All @@ -638,7 +638,7 @@ export default function App(props) {
}
};

const renderRelationAddAttribute = () => {
const RelationAddAttributeButton = () => {
if (
selected?.style?.includes("shape=rhombus") &&
diagramRef.current.relations.find(
Expand All @@ -657,7 +657,7 @@ export default function App(props) {
}
};

const renderToggleAttributes = () => {
const ToggleAttributesButton = () => {
const isEntity = selected?.style?.includes("shape=rectangle");
const isRelationNM =
selected?.style?.includes("shape=rhombus") &&
Expand Down Expand Up @@ -701,7 +701,7 @@ export default function App(props) {
}
};

const renderToggleAttrKey = () => {
const ToggleAttrKeyButton = () => {
const isAttribute = selected?.style?.includes("shape=ellipse");
let isKey;
let isFromRelation = false;
Expand Down Expand Up @@ -741,7 +741,7 @@ export default function App(props) {
}
};

const renderRelationConfiguration = () => {
const RelationConfigurationButton = () => {
const isRelation = selected?.style?.includes("shape=rhombus");
const [open, setOpen] = React.useState(false);
const [acceptDisabled, setAcceptDisabled] = React.useState(true);
Expand Down Expand Up @@ -993,7 +993,7 @@ export default function App(props) {
}
};

const renderRelationCardinalities = () => {
const RelationCardinalitiesButton = () => {
const isRelation = selected?.style?.includes("shape=rhombus");
const selectedDiag = diagramRef.current.relations.find(
(entity) => entity.idMx === selected?.id,
Expand Down Expand Up @@ -1182,7 +1182,7 @@ export default function App(props) {
}
};

const renderDeleteEntity = () => {
const DeleteEntityButton = () => {
const isEntity = selected?.style?.includes("shape=rectangle");
function deleteEntity() {
// Find the entity in diagramRef.current.entities
Expand Down Expand Up @@ -1272,7 +1272,7 @@ export default function App(props) {
}
};

const renderDeleteAttribute = () => {
const DeleteAttributeButton = () => {
const isAttribute = selected?.style?.includes("shape=ellipse");
let isKey;
let isFromRelation = false;
Expand Down Expand Up @@ -1380,7 +1380,7 @@ export default function App(props) {
}
};

const renderDeleteRelation = () => {
const DeleteRelationButton = () => {
const isRelation = selected?.style?.includes("shape=rhombus");

function deleteRelation() {
Expand Down Expand Up @@ -1427,7 +1427,7 @@ export default function App(props) {
}
};

const renderGenerateSQLButton = () => {
const GenerateSQLButton = () => {
const [open, setOpen] = React.useState(false);
const [acceptDisabled, setAcceptDisabled] = React.useState(true);
const [validationMessages, setValidationMessages] = React.useState([]);
Expand Down Expand Up @@ -1539,7 +1539,7 @@ export default function App(props) {
);
};

const renderExportJSONButton = () => {
const ExportJSONButton = () => {
const [open, setOpen] = React.useState(false);
const [acceptDisabled, setAcceptDisabled] = React.useState(true);
const [validationMessages, setValidationMessages] = React.useState([]);
Expand Down Expand Up @@ -1649,7 +1649,7 @@ export default function App(props) {
);
};

const renderImportJSONButton = () => {
const ImportJSONButton = () => {
const [open, setOpen] = React.useState(false);
const [validationMessages, setValidationMessages] = React.useState([]);

Expand Down Expand Up @@ -1776,7 +1776,7 @@ export default function App(props) {
graph.removeCells(cellsToRemove);
};

const renderResetCanvasButton = () => {
const ResetCanvasButton = () => {
const [open, setOpen] = React.useState(false);

const handleClickOpen = () => {
Expand Down Expand Up @@ -1833,24 +1833,24 @@ export default function App(props) {
<div className="mxgraph-toolbar-container">
<div className="mxgraph-toolbar-container" ref={toolbarRef} />

<div>{renderAddAttribute()}</div>
<div>{renderRelationAddAttribute()}</div>
<div>{renderToggleAttributes()}</div>
<div>{renderToggleAttrKey()}</div>
<div>{AddAttributeButton()}</div>
<div>{RelationAddAttributeButton()}</div>
<div>{ToggleAttributesButton()}</div>
<div>{ToggleAttrKeyButton()}</div>

<div>{renderRelationConfiguration()}</div>
<div>{renderRelationCardinalities()}</div>
<div>{RelationConfigurationButton()}</div>
<div>{RelationCardinalitiesButton()}</div>

<div>{renderDeleteEntity()}</div>
<div>{renderDeleteRelation()}</div>
<div>{renderDeleteAttribute()}</div>
<div>{DeleteEntityButton()}</div>
<div>{DeleteRelationButton()}</div>
<div>{DeleteAttributeButton()}</div>

<div>{renderMoveBackAndFrontButtons()}</div>
<div>{MoveBackAndFrontButtons()}</div>

<div>{renderGenerateSQLButton()}</div>
<div>{renderExportJSONButton()}</div>
<div>{renderImportJSONButton()}</div>
<div>{renderResetCanvasButton()}</div>
<div>{GenerateSQLButton()}</div>
<div>{ExportJSONButton()}</div>
<div>{ImportJSONButton()}</div>
<div>{ResetCanvasButton()}</div>
</div>
<div ref={containerRef} className="mxgraph-drawing-container" />
<Toaster position="bottom-left" />
Expand Down

0 comments on commit 647ee9b

Please sign in to comment.