zikade 0.1.0 → 0.1.2
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/dist/ZikadeProvider.d.ts +1 -2
- package/dist/ZikadeProvider.js +2 -2
- package/dist/useZikade.d.ts +2 -2
- package/dist/useZikade.js +1 -1
- package/package.json +1 -1
package/dist/ZikadeProvider.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import { createZikade } from "./createZikade";
|
|
3
2
|
import type { LocaleTranslations } from "./types";
|
|
4
3
|
type ZikadeContextType<T extends LocaleTranslations> = {
|
|
5
|
-
zikade:
|
|
4
|
+
zikade: any;
|
|
6
5
|
currentLocale: keyof T;
|
|
7
6
|
setLanguage: (locale: keyof T) => void;
|
|
8
7
|
};
|
package/dist/ZikadeProvider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useState, useMemo } from "react";
|
|
3
|
-
import { createZikade } from "./createZikade";
|
|
3
|
+
import { createZikade } from "./createZikade";
|
|
4
4
|
const ZikadeContext = createContext(undefined);
|
|
5
5
|
export function ZikadeProvider({ translations, defaultLocale, children }) {
|
|
6
6
|
const [currentLocale, setCurrentLocale] = useState(defaultLocale);
|
|
@@ -12,7 +12,7 @@ export function ZikadeProvider({ translations, defaultLocale, children }) {
|
|
|
12
12
|
const contextValue = useMemo(() => ({
|
|
13
13
|
zikade,
|
|
14
14
|
currentLocale,
|
|
15
|
-
setLanguage: setCurrentLocale
|
|
15
|
+
setLanguage: setCurrentLocale
|
|
16
16
|
}), [zikade, currentLocale]);
|
|
17
17
|
return _jsx(ZikadeContext.Provider, { value: contextValue, children: children });
|
|
18
18
|
}
|
package/dist/useZikade.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LocaleTranslations } from "./types
|
|
2
|
-
export declare function useZikade<T extends LocaleTranslations>():
|
|
1
|
+
import type { LocaleTranslations } from "./types";
|
|
2
|
+
export declare function useZikade<T extends LocaleTranslations>(): T[keyof T] & {
|
|
3
3
|
setLanguage: (locale: keyof T) => void;
|
|
4
4
|
};
|
package/dist/useZikade.js
CHANGED