-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX Reorder text checkbox group and apply Reactstrap styles
- Loading branch information
1 parent
784af9a
commit a99225e
Showing
8 changed files
with
1,363 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
client/src/components/TextCheckboxGroupField/TextCheckboxGroupField.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { InputGroup, InputGroupAddon, InputGroupText } from 'reactstrap'; | ||
import fieldHolder from 'components/FieldHolder/FieldHolder'; | ||
|
||
const TextCheckboxGroupField = () => { | ||
const { children } = this.props; | ||
|
||
const childrenWithProps = React.Children.toArray( | ||
React.Children.map(children, child => | ||
React.cloneElement(child, { noHolder: true }) | ||
) | ||
); | ||
return ( | ||
<InputGroup className="text-checkout-group-field"> | ||
{childrenWithProps[0]} | ||
<InputGroupAddon addonType="append"> | ||
<InputGroupText >{childrenWithProps[1]}</InputGroupText> | ||
</InputGroupAddon> | ||
</InputGroup> | ||
); | ||
}; | ||
|
||
export default fieldHolder(TextCheckboxGroupField); |
9 changes: 9 additions & 0 deletions
9
client/src/components/TextCheckboxGroupField/TextCheckboxGroupField.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Temporarily overwriting the styles form the CheckboxField component | ||
// since it cannot be removed easily | ||
.text-checkout-group-field { | ||
.form-check { | ||
display: inline; | ||
padding-left: 0; | ||
margin-bottom: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.