@c-rex/contexts 0.1.7 → 0.1.9

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": "@c-rex/contexts",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src"
@@ -41,5 +41,9 @@
41
41
  "@c-rex/services": "*",
42
42
  "@c-rex/utils": "*",
43
43
  "@c-rex/interfaces": "*"
44
+ },
45
+ "peerDependencies": {
46
+ "react": "^18.3.1",
47
+ "react-dom": "^18.3.1"
44
48
  }
45
49
  }
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import { CONTENT_LANG_KEY, CREX_TOKEN_HEADER_KEY, UI_LANG_KEY, UI_LANG_OPTIONS } from '@c-rex/constants'
4
- import { ConfigInterface, LanguageAndCountries, SidebarAvailableVersionsInterface } from '@c-rex/interfaces'
4
+ import { ConfigInterface, LanguageAndCountries, AvailableVersionsInterface } from '@c-rex/interfaces'
5
5
  import { call, getCookie, getFromCookieString, setCookie } from '@c-rex/utils'
6
6
  import { getConfigs } from '@c-rex/utils/next-cookies'
7
7
  import React, { createContext, useContext, useEffect, useState } from 'react'
@@ -14,11 +14,11 @@ type AppConfigContextType = {
14
14
  packageID: string | null
15
15
  contentLang: string | null
16
16
  articleLang: string | null
17
- availableVersions: SidebarAvailableVersionsInterface[] | null
17
+ availableVersions: AvailableVersionsInterface[] | null
18
18
  availableLanguagesAndCountries: LanguageAndCountries[]
19
19
  setUiLang: (lang: string | null) => void
20
20
  setContentLang: (lang: string | null) => void
21
- setAvailableVersions: (versions: SidebarAvailableVersionsInterface[] | null) => void
21
+ setAvailableVersions: (versions: AvailableVersionsInterface[] | null) => void
22
22
  setPackageID: (id: string | null) => void
23
23
  setArticleLang: (lang: string | null) => void
24
24
  }
@@ -33,7 +33,7 @@ export const AppConfigProvider = ({ children }: { children: React.ReactNode }) =
33
33
  const [packageID, setPackageID] = useState<string | null>(null)
34
34
  const [articleLang, setArticleLang] = useState<string | null>(null)
35
35
  const [contentLang, setContentLang] = useState<string | null>(null)
36
- const [availableVersions, setAvailableVersions] = useState<SidebarAvailableVersionsInterface[] | null>(null)
36
+ const [availableVersions, setAvailableVersions] = useState<AvailableVersionsInterface[] | null>(null)
37
37
  const [availableLanguagesAndCountries, setAvailableLanguagesAndCountries] = useState<LanguageAndCountries[] | null>(null)
38
38
 
39
39
  const manageUILanguage = async (configs: ConfigInterface): Promise<void> => {