Skip to content

Commit

Permalink
chore(Dialog): Add scrollable prop type defintion to DialogBody
Browse files Browse the repository at this point in the history
  • Loading branch information
elavigne-evertz committed Feb 15, 2018
1 parent 8b3d6bc commit 15b8b48
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
14 changes: 12 additions & 2 deletions src/Dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ export const DialogHeaderTitle = simpleTag({
classNames: 'mdc-dialog__header__title'
});


type DialogBodyT = {
/** Make it scrollable. */
scrollable?: boolean
} & SimpleTagPropsT;

/** The Dialog body */
export const DialogBody = simpleTag({
export class DialogBody extends simpleTag({
displayName: 'DialogBody',
tag: 'section',
classNames: props => [
Expand All @@ -52,7 +58,11 @@ export const DialogBody = simpleTag({
}
],
consumeProps: ['scrollable']
});
})<DialogBodyT> {
render() {
return super.render();
}
}

/** The Dialog footer */
export const DialogFooter = simpleTag({
Expand Down
22 changes: 9 additions & 13 deletions src/docs/docgen.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,20 +344,16 @@
{
"description": "The Dialog body",
"displayName": "DialogBody",
"methods": [
{
"name": "classNames",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "props",
"type": null
}
],
"returns": null
"methods": [],
"props": {
"scrollable": {
"flowType": {
"name": "boolean"
},
"required": false,
"description": "Make it scrollable."
}
]
}
},
{
"description": "The Dialog footer",
Expand Down

0 comments on commit 15b8b48

Please sign in to comment.