diff --git a/babel-translations.babel b/babel-translations.babel index 77e888e..8375a85 100644 --- a/babel-translations.babel +++ b/babel-translations.babel @@ -4898,9 +4898,140 @@ settings + + actions + + + clearcache + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + enablenotifications + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + labels + + notificationsenabled + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + signedinshop + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + signedinuser + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + theme + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + version false diff --git a/components-old/sign-out-button/sign-out-button.component.jsx b/components-old/sign-out-button/sign-out-button.component.jsx deleted file mode 100644 index 0baa8b8..0000000 --- a/components-old/sign-out-button/sign-out-button.component.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import { useTranslation } from "react-i18next"; -import { Button } from "react-native"; -import { connect } from "react-redux"; -import { createStructuredSelector } from "reselect"; -import { signOutStart } from "../../redux/user/user.actions"; -const mapStateToProps = createStructuredSelector({ - //currentUser: selectCurrentUser -}); -const mapDispatchToProps = (dispatch) => ({ - //setUserLanguage: language => dispatch(setUserLanguage(language)) - signOutStart: () => dispatch(signOutStart()), -}); - -export function SignOutButton({ signOutStart }) { - const { t } = useTranslation(); - return ( - - + @@ -109,8 +120,22 @@ function Tab({ bodyshop, currentUser }) { + + + + + + + + {`${t("settings.labels.notificationsenabled")}: ${ + permissionState?.granted === true ? "Yes" : "No" + }`} + + + - @@ -163,15 +156,18 @@ function Tab({ bodyshop, currentUser }) { - Signed in to bodyshop:{" "} - {bodyshop?.shopname || bodyshop?.id || "Unknown"} + {`${t("settings.labels.signedinshop")} ${ + bodyshop?.shopname || bodyshop?.id || "Unknown" + }`} - Signed in to as: {currentUser?.email || "Unknown"} + {`${t("settings.labels.signedinuser")} ${currentUser?.email || "Unknown"}`} - - + + diff --git a/translations/en-US/common.json b/translations/en-US/common.json index 663dd0d..b8a608d 100644 --- a/translations/en-US/common.json +++ b/translations/en-US/common.json @@ -293,7 +293,15 @@ } }, "settings": { + "actions": { + "clearcache": "Clear Cache", + "enablenotifications": "Enable Notifications" + }, "labels": { + "notificationsenabled": "Notifications Enabled", + "signedinshop": "Sign in to shop:", + "signedinuser": "Signed in as:", + "theme": "Theme", "version": "Version {{number}}" }, "titles": { diff --git a/translations/es-MX/common.json b/translations/es-MX/common.json index 74c8445..f395feb 100644 --- a/translations/es-MX/common.json +++ b/translations/es-MX/common.json @@ -293,7 +293,15 @@ } }, "settings": { + "actions": { + "clearcache": "", + "enablenotifications": "" + }, "labels": { + "notificationsenabled": "", + "signedinshop": "", + "signedinuser": "", + "theme": "", "version": "" }, "titles": { diff --git a/translations/fr-CA/common.json b/translations/fr-CA/common.json index 6169f11..dccfdc9 100644 --- a/translations/fr-CA/common.json +++ b/translations/fr-CA/common.json @@ -293,7 +293,15 @@ } }, "settings": { + "actions": { + "clearcache": "", + "enablenotifications": "" + }, "labels": { + "notificationsenabled": "", + "signedinshop": "", + "signedinuser": "", + "theme": "", "version": "" }, "titles": { diff --git a/util/notificationHandler.js b/util/notificationHandler.js index 14cef2b..a65a05e 100644 --- a/util/notificationHandler.js +++ b/util/notificationHandler.js @@ -52,14 +52,13 @@ async function registerForPushNotificationsAsync() { //Write the FCM token to database. - const result = await client.mutate({ + await client.mutate({ mutation: UPDATE_FCM_TOKEN, variables: { email: (await getCurrentUser()).email, token: { [pushTokenString]: { pushTokenString, platform: Platform.OS, timestamp: Date.now() } }, }, }); - console.log("FCM token updated in database:", result); return pushTokenString; } catch (error) { throw error