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,6 +1,6 @@
1
1
  {
2
2
  "name": "ikualo-ui-kit-mobile",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "start": "expo start",
@@ -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 "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 { 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
- const [component, setComponent] = useState('');
13
- const components = [
14
- { value: 'alerts', label: 'Alertas', component: <AlertsExamples /> },
15
- { value: 'btns', label: 'Botones', component: <BtnsExample /> },
16
- { value: 'inputs', label: 'Entradas', component: <InputsExamples /> },
17
- { value: 'cards', label: 'Cards', component: <CardsExamples /> },
18
- { value: 'dialogs', label: 'Modales', component: <DialogExamples /> },
19
- { value: 'others', label: 'Otros', component: <Others /> },
20
- // { value: 'progress-bar', label: 'Barra de progreso' },
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
- return (
28
- <>
29
- {components.find((c) => c.value === component)?.component ?? null}
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
- <View style={{ flex: 1, justifyContent: 'flex-end' }}>
32
- <Select
33
- label={"Componentes"}
34
- placeholder={"Selecciona el componente"}
35
- options={components}
36
- onSelect={(component) => setComponent(component)} />
37
- </View>
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
+ };