@reown/appkit-ui-react-native 0.0.0-develop-20251114173726 → 0.0.0-develop-20260126193726
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/lib/commonjs/context/ThemeContext.js +2 -5
- package/lib/commonjs/context/ThemeContext.js.map +1 -1
- package/lib/module/context/ThemeContext.js +2 -5
- package/lib/module/context/ThemeContext.js.map +1 -1
- package/lib/typescript/context/ThemeContext.d.ts +2 -2
- package/lib/typescript/context/ThemeContext.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/context/ThemeContext.tsx +4 -7
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ThemeContext = void 0;
|
|
7
7
|
exports.ThemeProvider = ThemeProvider;
|
|
8
8
|
exports.useTheme = useTheme;
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
9
|
var _react = require("react");
|
|
11
10
|
var _ThemeUtil = require("../utils/ThemeUtil");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -27,10 +26,8 @@ function ThemeProvider({
|
|
|
27
26
|
}
|
|
28
27
|
function useTheme() {
|
|
29
28
|
const context = (0, _react.useContext)(ThemeContext);
|
|
30
|
-
const scheme = (0, _reactNative.useColorScheme)();
|
|
31
29
|
return (0, _react.useMemo)(() => {
|
|
32
|
-
|
|
33
|
-
const themeMode = context?.themeMode ?? scheme;
|
|
30
|
+
const themeMode = context?.themeMode ?? 'light';
|
|
34
31
|
const themeVariables = context?.themeVariables ?? {};
|
|
35
32
|
let Theme = themeMode === 'dark' ? _ThemeUtil.DarkTheme : _ThemeUtil.LightTheme;
|
|
36
33
|
if (themeVariables.accent) {
|
|
@@ -40,6 +37,6 @@ function useTheme() {
|
|
|
40
37
|
};
|
|
41
38
|
}
|
|
42
39
|
return Theme;
|
|
43
|
-
}, [context?.themeMode, context?.themeVariables
|
|
40
|
+
}, [context?.themeMode, context?.themeVariables]);
|
|
44
41
|
}
|
|
45
42
|
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","require","_ThemeUtil","_jsxRuntime","ThemeContext","exports","createContext","undefined","ThemeProvider","children","themeMode","themeVariables","contextValue","useMemo","jsx","Provider","value","useTheme","context","useContext","Theme","DarkTheme","LightTheme","accent","getAccentColors"],"sourceRoot":"../../../src","sources":["context/ThemeContext.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAOrE,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,oBAAa,EAA+BC,SAAS,CAAC;AAQ3E,SAASC,aAAaA,CAAC;EAAEC,QAAQ;EAAEC,SAAS;EAAEC;AAAmC,CAAC,EAAE;EACzF,MAAMC,YAAY,GAAG,IAAAC,cAAO,EAAC,OAAO;IAAEH,SAAS;IAAEC;EAAe,CAAC,CAAC,EAAE,CAACD,SAAS,EAAEC,cAAc,CAAC,CAAC;EAEhG,oBAAO,IAAAR,WAAA,CAAAW,GAAA,EAACV,YAAY,CAACW,QAAQ;IAACC,KAAK,EAAEJ,YAAa;IAAAH,QAAA,EAAEA;EAAQ,CAAwB,CAAC;AACvF;AAEO,SAASQ,QAAQA,CAAA,EAAG;EACzB,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACf,YAAY,CAAC;EAExC,OAAO,IAAAS,cAAO,EAAC,MAAM;IACnB,MAAMH,SAAS,GAAGQ,OAAO,EAAER,SAAS,IAAI,OAAO;IAC/C,MAAMC,cAAc,GAAGO,OAAO,EAAEP,cAAc,IAAI,CAAC,CAAC;IAEpD,IAAIS,KAAK,GAAGV,SAAS,KAAK,MAAM,GAAGW,oBAAS,GAAGC,qBAAU;IAEzD,IAAIX,cAAc,CAACY,MAAM,EAAE;MACzBH,KAAK,GAAG;QACN,GAAGA,KAAK;QACR,GAAG,IAAAI,0BAAe,EAACb,cAAc,CAACY,MAAM;MAC1C,CAAC;IACH;IAEA,OAAOH,KAAK;EACd,CAAC,EAAE,CAACF,OAAO,EAAER,SAAS,EAAEQ,OAAO,EAAEP,cAAc,CAAC,CAAC;AACnD","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useColorScheme } from 'react-native';
|
|
4
3
|
import { createContext, useContext, useMemo } from 'react';
|
|
5
4
|
import { DarkTheme, LightTheme, getAccentColors } from '../utils/ThemeUtil';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,10 +20,8 @@ export function ThemeProvider({
|
|
|
21
20
|
}
|
|
22
21
|
export function useTheme() {
|
|
23
22
|
const context = useContext(ThemeContext);
|
|
24
|
-
const scheme = useColorScheme();
|
|
25
23
|
return useMemo(() => {
|
|
26
|
-
|
|
27
|
-
const themeMode = context?.themeMode ?? scheme;
|
|
24
|
+
const themeMode = context?.themeMode ?? 'light';
|
|
28
25
|
const themeVariables = context?.themeVariables ?? {};
|
|
29
26
|
let Theme = themeMode === 'dark' ? DarkTheme : LightTheme;
|
|
30
27
|
if (themeVariables.accent) {
|
|
@@ -34,6 +31,6 @@ export function useTheme() {
|
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
33
|
return Theme;
|
|
37
|
-
}, [context?.themeMode, context?.themeVariables
|
|
34
|
+
}, [context?.themeMode, context?.themeVariables]);
|
|
38
35
|
}
|
|
39
36
|
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","DarkTheme","LightTheme","getAccentColors","jsx","_jsx","ThemeContext","undefined","ThemeProvider","children","themeMode","themeVariables","contextValue","Provider","value","useTheme","context","Theme","accent"],"sourceRoot":"../../../src","sources":["context/ThemeContext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common-react-native';
|
|
3
3
|
type ThemeContextType = {
|
|
4
|
-
themeMode
|
|
4
|
+
themeMode: ThemeMode;
|
|
5
5
|
themeVariables?: ThemeVariables;
|
|
6
6
|
};
|
|
7
7
|
export declare const ThemeContext: import("react").Context<ThemeContextType | undefined>;
|
|
8
8
|
interface ThemeProviderProps {
|
|
9
9
|
children: ReactNode;
|
|
10
|
-
themeMode
|
|
10
|
+
themeMode: ThemeMode;
|
|
11
11
|
themeVariables?: ThemeVariables;
|
|
12
12
|
}
|
|
13
13
|
export declare function ThemeProvider({ children, themeMode, themeVariables }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/context/ThemeContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/context/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAInF,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,YAAY,uDAAyD,CAAC;AAEnF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,kBAAkB,2CAIxF;AAED,wBAAgB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-ui-react-native",
|
|
3
|
-
"version": "0.0.0-develop-
|
|
3
|
+
"version": "0.0.0-develop-20260126193726",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"provenance": true
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@reown/appkit-common-react-native": "0.0.0-develop-
|
|
43
|
+
"@reown/appkit-common-react-native": "0.0.0-develop-20260126193726",
|
|
44
44
|
"polished": "4.3.1",
|
|
45
45
|
"qrcode": "1.5.3"
|
|
46
46
|
},
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { useColorScheme } from 'react-native';
|
|
2
1
|
import { createContext, useContext, useMemo, type ReactNode } from 'react';
|
|
3
2
|
import type { ThemeMode, ThemeVariables } from '@reown/appkit-common-react-native';
|
|
4
3
|
|
|
5
4
|
import { DarkTheme, LightTheme, getAccentColors } from '../utils/ThemeUtil';
|
|
6
5
|
|
|
7
6
|
type ThemeContextType = {
|
|
8
|
-
themeMode
|
|
7
|
+
themeMode: ThemeMode;
|
|
9
8
|
themeVariables?: ThemeVariables;
|
|
10
9
|
};
|
|
11
10
|
|
|
@@ -13,7 +12,7 @@ export const ThemeContext = createContext<ThemeContextType | undefined>(undefine
|
|
|
13
12
|
|
|
14
13
|
interface ThemeProviderProps {
|
|
15
14
|
children: ReactNode;
|
|
16
|
-
themeMode
|
|
15
|
+
themeMode: ThemeMode;
|
|
17
16
|
themeVariables?: ThemeVariables;
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -25,11 +24,9 @@ export function ThemeProvider({ children, themeMode, themeVariables }: ThemeProv
|
|
|
25
24
|
|
|
26
25
|
export function useTheme() {
|
|
27
26
|
const context = useContext(ThemeContext);
|
|
28
|
-
const scheme = useColorScheme();
|
|
29
27
|
|
|
30
28
|
return useMemo(() => {
|
|
31
|
-
|
|
32
|
-
const themeMode = context?.themeMode ?? scheme;
|
|
29
|
+
const themeMode = context?.themeMode ?? 'light';
|
|
33
30
|
const themeVariables = context?.themeVariables ?? {};
|
|
34
31
|
|
|
35
32
|
let Theme = themeMode === 'dark' ? DarkTheme : LightTheme;
|
|
@@ -42,5 +39,5 @@ export function useTheme() {
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
return Theme;
|
|
45
|
-
}, [context?.themeMode, context?.themeVariables
|
|
42
|
+
}, [context?.themeMode, context?.themeVariables]);
|
|
46
43
|
}
|