forked from hossein-zare/react-native-dropdown-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (41 loc) · 1.06 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
46
47
48
49
import Picker from './src/components/Picker';
import {
DROPDOWN_DIRECTION,
LANGUAGE,
LIST_MODE,
MODE,
TRANSLATIONS,
} from './src/constants';
import THEMES from './src/themes';
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;
};
export default Picker;