Skip to content

Commit c424449

Browse files
authored
Merge pull request #374 from web-ridge/add-font-familyt-time-input
time input now inherits theme font family
2 parents ffd2a66 + 23e38f5 commit c424449

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

src/Time/TimeInput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
StyleSheet,
77
Platform,
88
} from 'react-native'
9-
import { useTheme, TouchableRipple } from 'react-native-paper'
9+
import { useTheme, TouchableRipple, MD2Theme } from 'react-native-paper'
1010

1111
import Color from 'color'
1212
import {
@@ -79,6 +79,9 @@ function TimeInput(
7979
// eslint-disable-next-line react-native/no-inline-styles
8080
{
8181
color,
82+
fontFamily: theme?.isV3
83+
? theme.fonts.titleMedium.fontFamily
84+
: (theme as any as MD2Theme).fonts.medium.fontFamily,
8285
fontSize: inputFontSize,
8386
backgroundColor,
8487
borderRadius: theme.roundness * 2,

src/__tests__/Time/__snapshots__/TimeInput.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ exports[`renders TimeInput 1`] = `
3131
"borderRadius": 8,
3232
"borderWidth": 2,
3333
"color": "rgba(33, 0, 93, 1)",
34+
"fontFamily": "System",
3435
"fontSize": 57,
3536
"height": 80,
3637
},

src/__tests__/Time/__snapshots__/TimeInputs.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ exports[`renders TimeInputs 1`] = `
5454
"borderRadius": 8,
5555
"borderWidth": 0,
5656
"color": "rgba(28, 27, 31, 1)",
57+
"fontFamily": "System",
5758
"fontSize": 57,
5859
"height": 72,
5960
},
@@ -193,6 +194,7 @@ exports[`renders TimeInputs 1`] = `
193194
"borderRadius": 8,
194195
"borderWidth": 0,
195196
"color": "rgba(28, 27, 31, 1)",
197+
"fontFamily": "System",
196198
"fontSize": 57,
197199
"height": 72,
198200
},

src/__tests__/Time/__snapshots__/TimePicker.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ exports[`renders TimePicker 1`] = `
6262
"borderRadius": 8,
6363
"borderWidth": 0,
6464
"color": "rgba(28, 27, 31, 1)",
65+
"fontFamily": "System",
6566
"fontSize": 57,
6667
"height": 72,
6768
},
@@ -201,6 +202,7 @@ exports[`renders TimePicker 1`] = `
201202
"borderRadius": 8,
202203
"borderWidth": 0,
203204
"color": "rgba(28, 27, 31, 1)",
205+
"fontFamily": "System",
204206
"fontSize": 57,
205207
"height": 72,
206208
},

0 commit comments

Comments
 (0)