Skip to content

Commit

Permalink
fix(FAB): add small size style (#3322)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumj25 committed Jan 31, 2022
1 parent 508f115 commit a3b8021
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/FAB/FAB.tsx
Expand Up @@ -73,7 +73,9 @@ export const FAB: RneFunctionComponent<FABProps> = ({
<Button
buttonStyle={StyleSheet.flatten([
rest.title
? styles.extendedLabel
? size === 'small'
? styles.smallExtendedLabel
: styles.extendedLabel
: size === 'small'
? styles.smallFAB
: styles.largeFAB,
Expand Down Expand Up @@ -140,6 +142,10 @@ const styles = StyleSheet.create({
height: 48,
paddingHorizontal: 16,
},
smallExtendedLabel: {
height: 40,
paddingHorizontal: 12,
},
disabled: {
elevation: 0,
},
Expand Down
2 changes: 1 addition & 1 deletion src/FAB/__tests__/FAB.test.tsx
Expand Up @@ -22,7 +22,7 @@ describe('FAB Component', () => {
);
expect(queryByText('test')).toBeTruthy();
expect(wrapper.findAllByType(View)[1].props.style).toMatchObject({
height: 48,
height: 40,
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/FAB/__tests__/__snapshots__/FAB.test.tsx.snap
Expand Up @@ -68,10 +68,10 @@ exports[`FAB Component should match snapshot 1`] = `
"borderRadius": 3,
"borderWidth": 0,
"flexDirection": "row",
"height": 48,
"height": 40,
"justifyContent": "center",
"padding": 8,
"paddingHorizontal": 16,
"paddingHorizontal": 12,
}
}
>
Expand Down

0 comments on commit a3b8021

Please sign in to comment.