Skip to content

Commit

Permalink
refactor(ui): button - apply mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
artyorsh authored Apr 8, 2019
1 parent ef61e17 commit c6b253f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 31 deletions.
6 changes: 3 additions & 3 deletions src/framework/ui/button/button.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class Button extends React.Component<Props> {
const {
textColor,
textFontSize,
textLineHeight,
textFontWeight,
textMarginHorizontal,
iconWidth,
Expand All @@ -97,16 +96,17 @@ export class Button extends React.Component<Props> {
text: {
color: textColor,
fontSize: textFontSize,
lineHeight: textLineHeight,
fontWeight: textFontWeight,
marginHorizontal: textMarginHorizontal,
...derivedTextStyle,
...styles.text,
},
icon: {
width: iconWidth,
height: iconHeight,
tintColor: iconTintColor,
marginHorizontal: iconMarginHorizontal,
...styles.icon,
},
};
};
Expand All @@ -116,7 +116,7 @@ export class Button extends React.Component<Props> {

return (
<Text
style={[style, styles.text]}
style={style}
key={1}>
{text}
</Text>
Expand Down
32 changes: 12 additions & 20 deletions src/framework/ui/button/button.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,12 @@ exports[`@button: matches snapshot * appearance * icon and text 1`] = `
/>
<ForwardRef(WrappingElement)
style={
Array [
Object {
"color": "#ffffff",
"fontSize": 14,
"fontWeight": "800",
"lineHeight": 16,
"marginHorizontal": 10,
},
Object {},
]
Object {
"color": "#ffffff",
"fontSize": 14,
"fontWeight": "800",
"marginHorizontal": 10,
}
}
>
BUTTON
Expand Down Expand Up @@ -570,16 +566,12 @@ exports[`@button: matches snapshot * appearance * text 1`] = `
>
<ForwardRef(WrappingElement)
style={
Array [
Object {
"color": "#ffffff",
"fontSize": 14,
"fontWeight": "800",
"lineHeight": 16,
"marginHorizontal": 10,
},
Object {},
]
Object {
"color": "#ffffff",
"fontSize": 14,
"fontWeight": "800",
"marginHorizontal": 10,
}
}
>
BUTTON
Expand Down
10 changes: 2 additions & 8 deletions src/framework/ui/common/mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@
"textFontSize": {
"type": "number"
},
"textLineHeight": {
"type": "number"
},
"textFontWeight": {
"type": "string"
},
Expand Down Expand Up @@ -400,8 +397,9 @@
"tiny": {
"minWidth": 24,
"minHeight": 24,
"paddingHorizontal": 6,
"paddingVertical": 6,
"textFontSize": 10,
"textLineHeight": 12,
"textMarginHorizontal": 6,
"iconWidth": 12,
"iconHeight": 12,
Expand All @@ -413,7 +411,6 @@
"paddingHorizontal": 8,
"paddingVertical": 8,
"textFontSize": 12,
"textLineHeight": 16,
"textMarginHorizontal": 8,
"iconWidth": 16,
"iconHeight": 16,
Expand All @@ -425,7 +422,6 @@
"paddingHorizontal": 10,
"paddingVertical": 12,
"textFontSize": 14,
"textLineHeight": 16,
"textMarginHorizontal": 10,
"iconWidth": 16,
"iconHeight": 16,
Expand All @@ -437,7 +433,6 @@
"paddingHorizontal": 10,
"paddingVertical": 14,
"textFontSize": 16,
"textLineHeight": 20,
"textMarginHorizontal": 10,
"iconWidth": 20,
"iconHeight": 20,
Expand All @@ -449,7 +444,6 @@
"paddingHorizontal": 12,
"paddingVertical": 16,
"textFontSize": 18,
"textLineHeight": 24,
"textMarginHorizontal": 12,
"iconWidth": 24,
"iconHeight": 24,
Expand Down

0 comments on commit c6b253f

Please sign in to comment.