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

Commit

Permalink
Merge pull request #231 from accordproject/dl-variable-colors
Browse files Browse the repository at this point in the history
feat(ClauseComponent): allow user to dictate color of variables or default to teal
  • Loading branch information
DianaLease authored Nov 21, 2019
2 parents 4b7dc91 + b7eeb42 commit 3b78969
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 101 deletions.
102 changes: 11 additions & 91 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
]
}
}
}
4 changes: 4 additions & 0 deletions src/ContractEditor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ const clausePropsObject = {
CLAUSE_BORDER (string),
CLAUSE_DELETE (string),
CLAUSE_DELETE_FUNCTION (function),
COMPUTED_COLOR (string),
HEADER_FONT (string),
HEADER_TITLE (string),
VARIABLE_COLOR (string),
}

const editorPropsObject = {
Expand Down Expand Up @@ -124,7 +126,9 @@ clauseProps = {
CLAUSE_BORDER, // (String)
CLAUSE_DELETE, // (String)
CLAUSE_DELETE_FUNCTION, // (Function)
COMPUTED_COLOR, // (String)
HEADER_FONT, // (String)
HEADER_TITLE, // (String)
VARIABLE_COLOR, // (String)
}
```
8 changes: 7 additions & 1 deletion src/components/ClauseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ function ClauseComponent(props) {
{deleteIcon.icon()}
</ S.ClauseDelete>
</S.DeleteWrapper>
<S.ClauseBody bodyfont={clauseProps.BODY_FONT} >
<S.ClauseBody
bodyfont={clauseProps.BODY_FONT}
variablecolor={clauseProps.VARIABLE_COLOR}
computedcolor={clauseProps.COMPUTED_COLOR}
>
{props.children}
</S.ClauseBody>
{errorsComponent}
Expand All @@ -102,9 +106,11 @@ ClauseComponent.propTypes = {
CLAUSE_BORDER: PropTypes.string,
CLAUSE_DELETE: PropTypes.string,
CLAUSE_DELETE_FUNCTION: PropTypes.func,
COMPUTED_COLOR: PropTypes.string,
HEADER_COLOR: PropTypes.string,
HEADER_FONT: PropTypes.string,
HEADER_TITLE: PropTypes.string,
VARIABLE_COLOR: PropTypes.string,
}),
};

Expand Down
6 changes: 6 additions & 0 deletions src/components/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export const ClauseHeader = styled.div`
`;

export const ClauseBody = styled.div`
.variable {
color: ${props => props.variablecolor || '#009593'};
}
.computed {
color: ${props => props.computedcolor || '#f1baff'};
}
font-family: ${props => props.bodyfont || 'Graphik'};
grid-area: sixteen / sixteen / twenty / twenty;
margin: 2px 0 10px;
Expand Down
8 changes: 0 additions & 8 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
background-color: #e98181;
}

.variable {
background-color: #ffeeba;
}

.computed {
background-color: #f1baff;
}

button.ui.button {
opacity: 1 !important;
}

0 comments on commit 3b78969

Please sign in to comment.