diff --git a/src/components/LanguageSwitcher.vue b/src/components/LanguageSwitcher.vue new file mode 100644 index 0000000..1cb9190 --- /dev/null +++ b/src/components/LanguageSwitcher.vue @@ -0,0 +1,32 @@ + + + \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index a0faf49..1eafdb8 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -14,5 +14,8 @@ import '@ionic/vue/css/text-transformation.css'; import '@ionic/vue/css/flex-utils.css'; import '@ionic/vue/css/display.css'; -export { default as ProductIdentifier } from "./ProductIdentifier.vue"; +import LanguageSwitcher from './LanguageSwitcher.vue'; +import ProductIdentifier from './ProductIdentifier.vue'; + +export { LanguageSwitcher, ProductIdentifier }; diff --git a/src/index.ts b/src/index.ts index ddace5c..c71a0d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,13 +8,14 @@ import { goToOms } from "./utils"; import { initialiseFirebaseApp } from "./utils/firebase" import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' -import { ProductIdentifier } from "./components"; +import { LanguageSwitcher, ProductIdentifier } from "./components"; // TODO: handle cases when the store from app or pinia store are not available // creating a pinia store for the plugin const pinia = createPinia(); pinia.use(piniaPluginPersistedstate) +let translate: any; let loginContext = {} as any let shopifyImgContext = {} as any let appContext = {} as any @@ -29,10 +30,13 @@ export let dxpComponents = { // registering pinia in the app app.use(pinia); + app.component('LanguageSwitcher', LanguageSwitcher) app.component('Login', Login) app.component('ShopifyImg', ShopifyImg) app.component('ProductIdentifier', ProductIdentifier) + translate = options.translate; + loginContext.login = options.login loginContext.logout = options.logout loginContext.loader = options.loader @@ -62,6 +66,7 @@ export { noitificationContext, ShopifyImg, shopifyImgContext, + translate, useProductIdentificationStore, useAuthStore, ProductIdentifier