forked from hossein-zare/react-native-dropdown-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (36 loc) · 1.1 KB
/
index.js
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
import { MODE, LIST_MODE, DROPDOWN_DIRECTION, LANGUAGE, TRANSLATIONS, HELPERS } from './src/constants';
import THEMES from './src/themes';
import Picker from './src/components/Picker';
Picker.MODE = MODE;
Picker.setMode = (mode) => {
Picker.MODE.DEFAULT = mode;
}
Picker.LIST_MODE = LIST_MODE;
Picker.setListMode = (mode) => {
Picker.LIST_MODE.DEFAULT = mode;
}
Picker.DROPDOWN_DIRECTION = DROPDOWN_DIRECTION;
Picker.setDropDownDirection = (direction) => {
Picker.DROPDOWN_DIRECTION.DEFAULT = direction;
}
Picker.LANGUAGE = LANGUAGE;
Picker.setLanguage = (language) => {
LANGUAGE.DEFAULT = language;
}
Picker.addTranslation = (language, translation) => {
TRANSLATIONS[language] = translation;
}
Picker.modifyTranslation = (language, translation) => {
if (TRANSLATIONS.hasOwnProperty(language)) {
TRANSLATIONS[language] = {...TRANSLATIONS[language], ...translation};
}
}
Picker.THEMES = THEMES;
Picker.setTheme = (name) => {
Picker.THEMES.DEFAULT = name;
}
Picker.addTheme = (name, theme) => {
Picker.THEMES[name] = theme;
}
Picker.HELPERS = HELPERS;
export default Picker;