-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: appropriately wrap component name
- Loading branch information
1 parent
bca4d17
commit 5b0c6b8
Showing
11 changed files
with
310 additions
and
263 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { branch, withProps } from 'recompose' | ||
import { createElement as $ } from 'react' | ||
|
||
import { hasNotProp } from './tools' | ||
import { setWrapperName } from './tools' | ||
|
||
export const boolean = branch( | ||
export const boolean = (Component) => | ||
/* | ||
Sets `value` to `false` if not set. | ||
Sets `value` to `false` if `nil`. | ||
*/ | ||
hasNotProp('value'), | ||
withProps({ value: false }), | ||
) | ||
setWrapperName(Component, function boolean(props) { | ||
const { value } = props | ||
return $(Component, { | ||
...props, | ||
value: value == null ? false : value, | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { branch, withProps } from 'recompose' | ||
import { createElement as $ } from 'react' | ||
|
||
import { hasNotProp } from './tools' | ||
import { setWrapperName } from './tools' | ||
|
||
export const date = branch( | ||
export const date = (Component) => | ||
/* | ||
Sets `value` to `new Date(0)` if not set. | ||
Sets `value` to `new Date(0)` if `nil`. | ||
*/ | ||
hasNotProp('value'), | ||
withProps({ value: new Date(0) }), | ||
) | ||
setWrapperName(Component, function date(props) { | ||
const { value } = props | ||
return $(Component, { | ||
...props, | ||
value: value == null ? new Date(0) : value, | ||
}) | ||
}) |
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
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.