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

Commit

Permalink
[Button] bugfixes in 0.0.28 release (#372)
Browse files Browse the repository at this point in the history
The patch did not apply correctly in #371. Fixes in current `PR`.
  • Loading branch information
hyochan authored Jan 10, 2021
1 parent 7689582 commit 5ccd1db
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CHANGELOGS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Changelogs

## 0.0.28
## 0.0.29

- Added `TouchableOpacity` style prop to [Button] [#37`](https://github.com/dooboolab/dooboo-ui/pull/371`).
- Added `TouchableOpacity` style prop to [Button] [#372](https://github.com/dooboolab/dooboo-ui/pull/372).

## 0.0.27

Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dooboo-ui",
"version": "0.0.28",
"version": "0.0.29",
"main": "index.js",
"types": "index.d.ts",
"author": "dooboolab",
Expand Down
23 changes: 14 additions & 9 deletions main/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function Button({
testID,
disabled,
loading,
styles: style,
style,
styles,
indicatorColor = '#ffffff',
leftElement,
rightElement,
Expand All @@ -94,33 +95,37 @@ function Button({
onPress={onPress}
delayPressIn={50}
disabled={disabled}
style={[
isHovered && !disabled && [defaultStyles.hovered, style?.hovered],
disabled && [defaultStyles.disabledButton, style?.disabledButton],
]}
style={style}
{...touchableOpacityProps}>
{loading ? (
<View
style={[
defaultStyles.container,
style?.container,
styles?.container,
{
width: layout?.width,
height: layout?.height,
},
isHovered && !disabled && [defaultStyles.hovered, styles?.hovered],
disabled && [defaultStyles.disabledButton, styles?.disabledButton],
]}>
<ActivityIndicator size="small" color={indicatorColor} />
</View>
) : (
<View
style={[defaultStyles.container, style?.container]}
style={[
defaultStyles.container,
styles?.container,
isHovered && !disabled && [defaultStyles.hovered, styles?.hovered],
disabled && [defaultStyles.disabledButton, styles?.disabledButton],
]}
onLayout={(e) => setLayout(e.nativeEvent.layout)}>
{leftElement}
<Text
style={[
defaultStyles.text,
style?.text,
disabled && [defaultStyles.disabledText, style?.disabledText],
styles?.text,
disabled && [defaultStyles.disabledText, styles?.disabledText],
]}
{...textProps}>
{text}
Expand Down

0 comments on commit 5ccd1db

Please sign in to comment.