ikualo-ui-kit-mobile 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Appearance } from 'react-native';
|
|
2
2
|
import { DefaultTheme } from 'react-native-paper';
|
|
3
|
+
|
|
3
4
|
const colors = {
|
|
4
5
|
dark_home: '#120B25',
|
|
5
6
|
dark_800: '#1D1F24',
|
|
@@ -215,3 +216,6 @@ export const lightTheme = {
|
|
|
215
216
|
let currentTheme = Appearance.getColorScheme() === 'dark' ? darkTheme : lightTheme;
|
|
216
217
|
|
|
217
218
|
export const getGlobalTheme = () => currentTheme;
|
|
219
|
+
export const setGlobalTheme = (theme: 'light' | 'dark' | 'system') => {
|
|
220
|
+
Appearance.setColorScheme(theme !== 'system' ? theme : null);
|
|
221
|
+
};
|
|
@@ -1,41 +1,55 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { Select } from
|
|
3
|
-
import { AlertsExamples } from
|
|
4
|
-
import { BtnsExample } from
|
|
5
|
-
import { CardsExamples } from
|
|
6
|
-
import { View } from
|
|
7
|
-
import { InputsExamples } from
|
|
8
|
-
import { DialogExamples } from
|
|
9
|
-
import { Others } from
|
|
10
|
-
import { Navbar } from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Select } from '../select/Select';
|
|
3
|
+
import { AlertsExamples } from '../alerts/AlertsExamples';
|
|
4
|
+
import { BtnsExample } from '../buttons/BtnsExample';
|
|
5
|
+
import { CardsExamples } from '../cards/CardsExamples';
|
|
6
|
+
import { View } from 'react-native';
|
|
7
|
+
import { InputsExamples } from '../inputs/InputsExamples';
|
|
8
|
+
import { DialogExamples } from '../dialogs/DialogExamples';
|
|
9
|
+
import { Others } from './Others';
|
|
10
|
+
import { BtnContained, Navbar } from '../../';
|
|
11
|
+
import { setGlobalTheme } from '../../config/paper.config';
|
|
11
12
|
export const Views = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// { value: 'tabs', label: 'Pestañas' },
|
|
22
|
-
// { value: 'text', label: 'Tipografía' },
|
|
23
|
-
// { value: 'dropdown', label: 'Lista desplegable' },
|
|
24
|
-
// { value: 'timer', label: 'Temporizador' },
|
|
25
|
-
]
|
|
13
|
+
const [component, setComponent] = useState('');
|
|
14
|
+
const components = [
|
|
15
|
+
{ value: 'alerts', label: 'Alertas', component: <AlertsExamples /> },
|
|
16
|
+
{ value: 'btns', label: 'Botones', component: <BtnsExample /> },
|
|
17
|
+
{ value: 'inputs', label: 'Entradas', component: <InputsExamples /> },
|
|
18
|
+
{ value: 'cards', label: 'Cards', component: <CardsExamples /> },
|
|
19
|
+
{ value: 'dialogs', label: 'Modales', component: <DialogExamples /> },
|
|
20
|
+
{ value: 'others', label: 'Otros', component: <Others /> },
|
|
21
|
+
];
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<BtnContained
|
|
26
|
+
text="light"
|
|
27
|
+
onPress={() => {
|
|
28
|
+
setGlobalTheme('light');
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
<BtnContained
|
|
32
|
+
text="dark"
|
|
33
|
+
onPress={() => {
|
|
34
|
+
setGlobalTheme('dark');
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
<BtnContained
|
|
38
|
+
text="system"
|
|
39
|
+
onPress={() => {
|
|
40
|
+
setGlobalTheme('system');
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
{components.find((c) => c.value === component)?.component ?? null}
|
|
30
44
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
45
|
+
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
46
|
+
<Select
|
|
47
|
+
label={'Componentes'}
|
|
48
|
+
placeholder={'Selecciona el componente'}
|
|
49
|
+
options={components}
|
|
50
|
+
onSelect={(component) => setComponent(component)}
|
|
51
|
+
/>
|
|
52
|
+
</View>
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
};
|