Skip to content

Commit 2f1e136

Browse files
authored
feat: possibility to set theme in PaperProvider (#5)
1 parent 947f5de commit 2f1e136

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Paper__PaperProvider.re

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[@bs.module "react-native-paper"] [@react.component]
2-
external make: (~children: React.element) => React.element = "Provider";
2+
external make:
3+
(~children: React.element, ~theme: Paper__ThemeProvider.Theme.t=?) =>
4+
React.element =
5+
"Provider";

src/Paper__ThemeProvider.re

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,29 @@ module Theme = {
4848
(~regular: font, ~medium: font, ~light: font, ~thin: font) => t;
4949
};
5050

51+
module Animation = {
52+
type t;
53+
54+
[@bs.obj] external make: (~scale: float) => t;
55+
56+
[@bs.get] external scale: t => float = "scale";
57+
};
58+
5159
[@bs.obj]
5260
external make:
5361
(
5462
~roundness: int=?,
5563
~dark: bool=?,
5664
~colors: Colors.t=?,
5765
~fonts: Fonts.configured=?,
66+
~animation: Animation.t=?,
5867
unit
5968
) =>
6069
t;
6170

6271
[@bs.get] external fonts: t => Fonts.configured = "fonts";
6372
[@bs.get] external colors: t => Colors.t = "colors";
73+
[@bs.get] external animation: t => Animation.t = "animation";
6474
[@bs.get] external dark: t => bool = "dark";
6575
};
6676

0 commit comments

Comments
 (0)