Skip to content

Commit

Permalink
Specify text/icon spacing rather than reusing horizontal padding.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswilddev committed Nov 24, 2021
1 parent 62f299b commit 813ed74
Show file tree
Hide file tree
Showing 5 changed files with 649 additions and 12 deletions.
12 changes: 6 additions & 6 deletions components/createButtonComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,20 @@ export const createButtonComponent = (

const leftIconBase: TextStyle = {};

if (buttonStyle.horizontalPadding) {
leftIconBase.paddingLeft = buttonStyle.horizontalPadding;
if (buttonStyle.iconSpacing) {
leftIconBase.paddingLeft = buttonStyle.iconSpacing;
}

const rightIconBase: TextStyle = {};

if (buttonStyle.horizontalPadding) {
rightIconBase.paddingRight = buttonStyle.horizontalPadding;
if (buttonStyle.iconSpacing) {
rightIconBase.paddingRight = buttonStyle.iconSpacing;
}

const leftAndRightIconsBase: TextStyle = {};

if (buttonStyle.horizontalPadding) {
leftAndRightIconsBase.paddingHorizontal = buttonStyle.horizontalPadding;
if (buttonStyle.iconSpacing) {
leftAndRightIconsBase.paddingHorizontal = buttonStyle.iconSpacing;
}

const styles = StyleSheet.create({
Expand Down
1 change: 1 addition & 0 deletions components/createButtonComponent/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ExampleDropDown = createButtonComponent({
fontSize: 16,
horizontalPadding: 10,
verticalPadding: 2,
iconSpacing: 5,
default: {
backgroundColor: `yellow`,
color: `blue`,
Expand Down
Loading

0 comments on commit 813ed74

Please sign in to comment.