Skip to content

Commit

Permalink
Merge pull request #374 from web-ridge/add-font-familyt-time-input
Browse files Browse the repository at this point in the history
time input now inherits theme font family
  • Loading branch information
iM-GeeKy authored Apr 10, 2024
2 parents ffd2a66 + 23e38f5 commit c424449
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Time/TimeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
StyleSheet,
Platform,
} from 'react-native'
import { useTheme, TouchableRipple } from 'react-native-paper'
import { useTheme, TouchableRipple, MD2Theme } from 'react-native-paper'

import Color from 'color'
import {
Expand Down Expand Up @@ -79,6 +79,9 @@ function TimeInput(
// eslint-disable-next-line react-native/no-inline-styles
{
color,
fontFamily: theme?.isV3
? theme.fonts.titleMedium.fontFamily
: (theme as any as MD2Theme).fonts.medium.fontFamily,
fontSize: inputFontSize,
backgroundColor,
borderRadius: theme.roundness * 2,
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/Time/__snapshots__/TimeInput.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ exports[`renders TimeInput 1`] = `
"borderRadius": 8,
"borderWidth": 2,
"color": "rgba(33, 0, 93, 1)",
"fontFamily": "System",
"fontSize": 57,
"height": 80,
},
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/Time/__snapshots__/TimeInputs.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ exports[`renders TimeInputs 1`] = `
"borderRadius": 8,
"borderWidth": 0,
"color": "rgba(28, 27, 31, 1)",
"fontFamily": "System",
"fontSize": 57,
"height": 72,
},
Expand Down Expand Up @@ -193,6 +194,7 @@ exports[`renders TimeInputs 1`] = `
"borderRadius": 8,
"borderWidth": 0,
"color": "rgba(28, 27, 31, 1)",
"fontFamily": "System",
"fontSize": 57,
"height": 72,
},
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/Time/__snapshots__/TimePicker.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ exports[`renders TimePicker 1`] = `
"borderRadius": 8,
"borderWidth": 0,
"color": "rgba(28, 27, 31, 1)",
"fontFamily": "System",
"fontSize": 57,
"height": 72,
},
Expand Down Expand Up @@ -201,6 +202,7 @@ exports[`renders TimePicker 1`] = `
"borderRadius": 8,
"borderWidth": 0,
"color": "rgba(28, 27, 31, 1)",
"fontFamily": "System",
"fontSize": 57,
"height": 72,
},
Expand Down

0 comments on commit c424449

Please sign in to comment.