Repository: callstack/react-native-paper
Pull request #1220 (2019-07-16 14:35:29)

refactor: specify the font from theme in chip


### Motivation

Fixes: #1153 

Specify the `font` from the `theme`

### Test plan

Tested on a device.


callstack-bot: Hey @lukewalczak, thank you for your pull request 🤗. The documentation from this branch can be viewed [here](https://11870-71323749-gh.circle-artifacts.com/0/docs/index.html).

Patch:
diff --git a/src/components/Chip.tsx b/src/components/Chip.tsx
index 0ee92cfb6..09519bfd5 100644
--- a/src/components/Chip.tsx
+++ b/src/components/Chip.tsx
@@ -279,6 +279,7 @@ class Chip extends React.Component<Props, State> {
               style={[
                 styles.text,
                 {
+                  ...theme.fonts.regular,
                   color: textColor,
                   marginRight: onClose ? 4 : 8,
                   marginLeft: avatar || icon || selected ? 4 : 8,


Test patch:
diff --git a/src/components/__tests__/__snapshots__/Chip.test.js.snap b/src/components/__tests__/__snapshots__/Chip.test.js.snap
index accc96d86..645f696e5 100644
--- a/src/components/__tests__/__snapshots__/Chip.test.js.snap
+++ b/src/components/__tests__/__snapshots__/Chip.test.js.snap
@@ -109,6 +109,8 @@ exports[`renders chip with close button 1`] = `
               },
               Object {
                 "color": "rgba(0, 0, 0, 0.87)",
+                "fontFamily": "System",
+                "fontWeight": "400",
                 "marginLeft": 4,
                 "marginRight": 4,
               },
@@ -284,6 +286,8 @@ exports[`renders chip with icon 1`] = `
               },
               Object {
                 "color": "rgba(0, 0, 0, 0.87)",
+                "fontFamily": "System",
+                "fontWeight": "400",
                 "marginLeft": 4,
                 "marginRight": 8,
               },
@@ -363,6 +367,8 @@ exports[`renders chip with onPress 1`] = `
               },
               Object {
                 "color": "rgba(0, 0, 0, 0.87)",
+                "fontFamily": "System",
+                "fontWeight": "400",
                 "marginLeft": 8,
                 "marginRight": 8,
               },
@@ -446,6 +452,8 @@ exports[`renders outlined disabled chip 1`] = `
               },
               Object {
                 "color": "rgba(0, 0, 0, 0.26)",
+                "fontFamily": "System",
+                "fontWeight": "400",
                 "marginLeft": 8,
                 "marginRight": 8,
               },
@@ -574,6 +582,8 @@ exports[`renders selected chip 1`] = `
               },
               Object {
                 "color": "rgba(0, 0, 0, 0.87)",
+                "fontFamily": "System",
+                "fontWeight": "400",
                 "marginLeft": 4,
                 "marginRight": 8,
               },
diff --git a/src/components/__tests__/__snapshots__/ListItem.test.js.snap b/src/components/__tests__/__snapshots__/ListItem.test.js.snap
index 802bad892..b50b19b71 100644
--- a/src/components/__tests__/__snapshots__/ListItem.test.js.snap
+++ b/src/components/__tests__/__snapshots__/ListItem.test.js.snap
@@ -190,6 +190,8 @@ exports[`renders list item with custom description 1`] = `
                         },
                         Object {
                           "color": "rgba(0, 0, 0, 0.87)",
+                          "fontFamily": "System",
+                          "fontWeight": "400",
                           "marginLeft": 4,
                           "marginRight": 8,
                         },