Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
fix(components): remove hardcoded id - I233
Browse files Browse the repository at this point in the history
Signed-off-by: irmerk <[email protected]>
  • Loading branch information
jolanglinais committed Feb 26, 2020
1 parent d0bbcb2 commit b9f316f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/ClauseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function ClauseComponent(props) {
const findConditionals = node => ({
...(((node.type === 'conditional') && (node.data.get('whenFalse') === '')) ? {
[node.key]: {
id: node.data.get('id'),
whenTrue: node.data.get('whenTrue'),
whenFalse: node.data.get('whenFalse'),
position: findPosition(node.key),
Expand Down Expand Up @@ -89,7 +90,7 @@ function ClauseComponent(props) {
object: 'inline',
type: 'conditional',
data: {
id: 'forceMajeure',
id: selectedConditional.id,
whenTrue: selectedConditional.whenTrue,
whenFalse: selectedConditional.whenFalse
},
Expand Down
5 changes: 3 additions & 2 deletions src/components/Conditional.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Conditional = (props) => {
const { attributes, children, node } = props;
const [hovering, setHovering] = useState(false);
const conditional = {
id: node.data.get('id'),
whenTrue: node.data.get('whenTrue'),
whenFalse: node.data.get('whenFalse'),
isFalse: node.text === node.data.get('whenFalse'),
Expand All @@ -25,7 +26,7 @@ const Conditional = (props) => {
object: 'inline',
type: 'conditional',
data: {
id: 'forceMajeure',
id: conditional.id,
whenTrue: conditional.whenTrue,
whenFalse: conditional.whenFalse
},
Expand All @@ -45,7 +46,7 @@ const Conditional = (props) => {
};

const conditionalProps = {
id: node.data.get('id'),
id: conditional.id,
className: 'conditional',
onMouseEnter: () => setHovering(true),
onMouseLeave: () => setHovering(false),
Expand Down

0 comments on commit b9f316f

Please sign in to comment.