Skip to content

Commit bfdc79f

Browse files
authored
Merge pull request #7 from troberts-28/patch-v1.1.4
Add base text style
2 parents d3c99c2 + 090f73b commit bfdc79f

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ The following custom styles can be supplied to re-style the component in any way
326326
| :-------------------: | :------------------------------------- | :-----------------------------------: |
327327
| theme | Theme of the component | "light" \| "dark" |
328328
| backgroundColor | Main background color | string |
329-
| textColor | Color for the text elements | string |
329+
| text | Base text style | TextStyle |
330330
| pickerContainer | Main container for the picker | ViewStyle |
331331
| pickerLabelContainer | Container for the picker's labels | ViewStyle |
332332
| pickerLabel | Style for the picker's labels | TextStyle |
@@ -365,9 +365,9 @@ The following custom styles can be supplied to re-style the component in any way
365365
| container | Main container's style | ViewStyle |
366366
| contentContainer | Style for the content's container | ViewStyle |
367367
| buttonContainer | Style for the container around the buttons | ViewStyle |
368-
| button | General style for both buttons | ViewStyle |
369-
| cancelButton | Style for the cancel button | ViewStyle |
370-
| confirmButton | Style for the confirm button | ViewStyle |
368+
| button | General style for both buttons | TextStyle |
369+
| cancelButton | Style for the cancel button | TextStyle |
370+
| confirmButton | Style for the confirm button | TextStyle |
371371
| modalTitle | Style for the title of the modal | TextStyle |
372372

373373

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"url": "https://github.com/troberts-28"
77
},
88
"license": "MIT",
9-
"version": "1.1.3",
9+
"version": "1.1.4",
1010
"main": "dist/index.js",
1111
"types": "dist/index.d.ts",
1212
"scripts": {

src/components/TimerPicker/TimerPicker.styles.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { StyleSheet } from "react-native";
44
export interface CustomTimerPickerStyles {
55
theme?: "light" | "dark";
66
backgroundColor?: string;
7-
textColor?: string;
7+
text?: any;
88
pickerContainer?: any;
99
pickerLabelContainer?: any;
1010
pickerLabel?: any;
@@ -46,10 +46,10 @@ export const generateStyles = (
4646
fontWeight: "bold",
4747
marginTop: (customStyles?.pickerItem?.fontSize ?? 25) / 6,
4848
color:
49-
customStyles?.textColor ??
50-
(customStyles?.theme === "dark"
49+
customStyles?.theme === "dark"
5150
? DARK_MODE_TEXT_COLOR
52-
: LIGHT_MODE_TEXT_COLOR),
51+
: LIGHT_MODE_TEXT_COLOR,
52+
...customStyles?.text,
5353
...customStyles?.pickerLabel,
5454
},
5555
pickerItemContainer: {
@@ -63,10 +63,10 @@ export const generateStyles = (
6363
textAlignVertical: "center",
6464
fontSize: 25,
6565
color:
66-
customStyles?.textColor ??
67-
(customStyles?.theme === "dark"
66+
customStyles?.theme === "dark"
6867
? DARK_MODE_TEXT_COLOR
69-
: LIGHT_MODE_TEXT_COLOR),
68+
: LIGHT_MODE_TEXT_COLOR,
69+
...customStyles?.text,
7070
...customStyles?.pickerItem,
7171
},
7272
pickerGradientOverlay: {

src/components/TimerPickerModal.styles.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { StyleSheet } from "react-native";
33

44
import type { CustomTimerPickerStyles } from "./TimerPicker/TimerPicker.styles";
55

6-
export interface CustomTimerPickerModalStyles
7-
extends CustomTimerPickerStyles {
6+
export interface CustomTimerPickerModalStyles extends CustomTimerPickerStyles {
87
container?: any;
98
contentContainer?: any;
109
buttonContainer?: any;
@@ -53,36 +52,36 @@ export const generateStyles = (
5352
borderRadius: 10,
5453
fontSize: 16,
5554
overflow: "hidden",
55+
...customStyles?.text,
5656
...customStyles?.button,
5757
},
5858
cancelButton: {
5959
borderColor: "gray",
6060
color:
61-
customStyles?.textColor ?? customStyles?.theme === "dark"
62-
? DARK_MODE_TEXT_COLOR
63-
: "gray",
61+
customStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : "gray",
6462
backgroundColor:
6563
customStyles?.theme === "dark" ? "gray" : undefined,
64+
...customStyles?.text,
6665
...customStyles?.cancelButton,
6766
},
6867
confirmButton: {
6968
borderColor: "green",
7069
color:
71-
customStyles?.textColor ?? customStyles?.theme === "dark"
72-
? DARK_MODE_TEXT_COLOR
73-
: "green",
70+
customStyles?.theme === "dark" ? DARK_MODE_TEXT_COLOR : "green",
7471
backgroundColor:
7572
customStyles?.theme === "dark" ? "green" : undefined,
73+
...customStyles?.text,
7674
...customStyles?.confirmButton,
7775
},
7876
modalTitle: {
7977
fontSize: 24,
8078
fontWeight: "bold",
8179
marginBottom: 15,
8280
color:
83-
customStyles?.textColor ?? customStyles?.theme === "dark"
81+
customStyles?.theme === "dark"
8482
? DARK_MODE_TEXT_COLOR
8583
: LIGHT_MODE_TEXT_COLOR,
84+
...customStyles?.text,
8685
...customStyles?.modalTitle,
8786
},
8887
});

0 commit comments

Comments
 (0)