forked from pagopa/io-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
88 lines (84 loc) · 2.45 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* This file exports a function to create the whole theme of the application.
* It takes our custom variables and mixes them with each defined component theme.
*/
import merge from "lodash/merge";
import getTheme from "native-base/src/theme/components";
import baseScreenComponentTheme from "./components/BaseScreenComponent";
import buttonTheme from "./components/Button";
import contentTheme from "./components/Content";
import headerTheme from "./components/Header";
import iconFontTheme from "./components/IconFont";
import inputTheme from "./components/Input";
import itemTheme from "./components/Item";
import labelTheme from "./components/Label";
import listTheme from "./components/List";
import listItemTheme from "./components/ListItem";
import maskedInputTheme from "./components/MaskedInput";
import messageDetailsInfoComponentTheme from "./components/MessageDetailsInfoComponent";
import preferenceItemTheme from "./components/PreferenceItem";
import screenHeaderTheme from "./components/ScreenHeader";
import textTheme from "./components/Text";
import textWithIconTheme from "./components/TextWithIcon";
import viewTheme from "./components/View";
import { Theme } from "./types";
import variables from "./variables";
const theme = (): Theme => {
const nbTheme = getTheme(variables);
const overrides = {
"NativeBase.Button": {
...buttonTheme()
},
"NativeBase.Content": {
...contentTheme()
},
"NativeBase.Header": {
...headerTheme()
},
"NativeBase.Item": {
...itemTheme()
},
"NativeBase.Label": {
...labelTheme()
},
"NativeBase.Text": {
...textTheme()
},
"NativeBase.Input": {
...inputTheme()
},
"UIComponent.TextWithIcon": {
...textWithIconTheme()
},
"UIComponent.IconFont": {
...iconFontTheme()
},
"NativeBase.ViewNB": {
...viewTheme()
},
"UIComponent.MessageDetailsInfoComponent": {
...messageDetailsInfoComponentTheme()
},
"UIComponent.PreferenceItem": {
...preferenceItemTheme()
},
"UIComponent.ScreenHeader": {
...screenHeaderTheme()
},
"NativeBase.List": {
...listTheme()
},
"NativeBase.ListItem": {
...listItemTheme()
},
"UIComponent.BaseScreenComponent": {
...baseScreenComponentTheme()
},
"UIComponent.MaskedInput": {
...maskedInputTheme()
}
};
// We need ad deep merge
return merge(nbTheme, overrides);
};
export default theme;