@nuskin/routine-feature 2.0.2 → 3.0.0

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.
@@ -11,7 +11,6 @@ var _client = require("@apollo/client");
11
11
  var _native = require("@react-navigation/native");
12
12
  var _mobileUi = require("@ns/mobile-ui");
13
13
  var _utilsModule = require("@nuskin/utils-module");
14
- var _valtio = require("valtio");
15
14
  var _RoutineDetails = _interopRequireDefault(require("./RoutineDetails"));
16
15
  var _mobileLogging = require("@nuskin/mobile-logging");
17
16
  var _Accessibility = require("./helpers/Accessibility");
@@ -128,7 +127,7 @@ const ListItem = _ref => {
128
127
  })))));
129
128
  };
130
129
  const Routines = () => {
131
- const localizationStore = (0, _valtio.useSnapshot)(_utilsModule.localizationState);
130
+ const localeState = _utilsModule.localization.useLocalization().locale;
132
131
  const [refresh, setRefresh] = (0, _react.useState)(false);
133
132
  const locale = _utilsModule.localization.getLocalization(_utilsModule.localization.LocalizationFormat.CONTENT_STACK);
134
133
  const hideFeaturesByMarket = (0, _utilsModule.useMarketFlagsStore)(state => state.flags.hideVeraFeaturesByMarket);
@@ -144,7 +143,7 @@ const Routines = () => {
144
143
  });
145
144
  (0, _react.useEffect)(() => {
146
145
  setRefresh(!refresh);
147
- }, [localizationStore]);
146
+ }, [localeState]);
148
147
  const routinesPageData = data ? data.result.items[0] : {};
149
148
  if (error || !routinesPageData) {
150
149
  var _error$graphQLErrors$, _error$graphQLErrors$2, _error$graphQLErrors$3;
@@ -1 +1 @@
1
- {"version":3,"names":["Stack","createStackNavigator","FETCH_ROUTINES_PAGE","gql","ListItem","item","index","navigation","useNavigation","handleOnPress","navigate","styles","itemContainer","accessibility","uri","routine_imageConnection","edges","node","url","itemPhoto","itemTextContainer","itemTitleContainer","itemTextTitle","routine_title","itemTextSteps","steps","length","routine_step_label","listContainer","itemText","products_used_label","products","product_imageConnection","productPhoto","Routines","localizationStore","useSnapshot","localizationState","refresh","setRefresh","useState","locale","localization","getLocalization","LocalizationFormat","CONTENT_STACK","hideFeaturesByMarket","useMarketFlagsStore","state","flags","hideVeraFeaturesByMarket","loading","error","data","refetch","useQuery","variables","useEffect","routinesPageData","result","items","errorCode","graphQLErrors","extensions","errors","code","container","title","routinesContainer","sortListText","sort_list_label","routines","paddingHorizontal","RoutineStack","unsubscribe","addListener","Logger","info","headerShown","RoutineDetails","StyleSheet","create","flex","backgroundColor","colors","white","primaryGray","paddingTop","flexDirection","paddingVertical","sectionHeader","textTransform","fontWeight","fontSize","marginTop","marginBottom","margin","borderRadius","paddingBottom","width","minHeight","height","borderColor","borderWidth","justifyContent","color","primaryBlack","letterSpacing","textAlign","marginRight","paddingRight"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n FlatList,\n Image,\n SafeAreaView,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n ActivityIndicator,\n} from 'react-native';\nimport { gql, useQuery } from '@apollo/client';\nimport { useNavigation } from '@react-navigation/native';\nimport {\n VeraHeader,\n Logo,\n HeaderCart,\n HeaderAccount,\n colors,\n ErrorScreen,\n} from '@ns/mobile-ui';\nimport {\n localization,\n localizationState,\n useMarketFlagsStore,\n} from '@nuskin/utils-module';\nimport { useSnapshot } from 'valtio';\nimport RoutineDetails from './RoutineDetails';\nimport { Logger } from '@nuskin/mobile-logging';\nimport { accessibility } from './helpers/Accessibility';\nimport { createStackNavigator } from '@react-navigation/stack';\n\nconst Stack = createStackNavigator();\nexport const FETCH_ROUTINES_PAGE = gql`\n query fetchAllHomePages($locale: String) {\n result: all_routine(fallback_locale: true, locale: $locale) {\n items {\n products_used_label\n sort_list_label\n title\n routines {\n products {\n product_name\n product_category\n product_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n }\n products_used_label\n routine_title\n routine_subtitle\n routines_description\n routine_step_label\n reference\n routine_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n steps {\n imageConnection {\n edges {\n node {\n url\n }\n }\n }\n step_sub_description\n step_title\n step_description\n style\n image_title\n image_description\n }\n }\n }\n }\n }\n`;\n\nconst ListItem = ({ item, index }) => {\n const navigation = useNavigation();\n const handleOnPress = () => {\n navigation.navigate('RoutineDetails' as never, item as never);\n };\n return (\n <View style={styles.itemContainer}>\n <TouchableOpacity onPress={handleOnPress}>\n <View>\n <Image\n {...accessibility(`list-item-${index}`)}\n source={{\n uri: item.routine_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.itemPhoto}\n />\n </View>\n <View style={styles.itemTextContainer}>\n <View style={styles.itemTitleContainer}>\n <Text\n {...accessibility(`list-item-title-${index}`)}\n style={styles.itemTextTitle}\n >\n {item.routine_title}\n </Text>\n <Text style={styles.itemTextSteps}>\n {item.steps.length} {item.routine_step_label}\n </Text>\n </View>\n <View style={styles.listContainer}>\n <Text style={styles.itemText}>{item.products_used_label}</Text>\n <FlatList\n data={item.products}\n horizontal\n renderItem={({ item, index }) => (\n <Image\n key={index}\n {...accessibility(`list-item-product-${index}`)}\n source={{\n uri: item.product_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.productPhoto}\n resizeMode=\"contain\"\n />\n )}\n showsHorizontalScrollIndicator={false}\n />\n </View>\n </View>\n </TouchableOpacity>\n </View>\n );\n};\n\nconst Routines = () => {\n const localizationStore = useSnapshot(localizationState);\n const [refresh, setRefresh] = useState(false);\n const locale = localization.getLocalization(\n localization.LocalizationFormat.CONTENT_STACK\n );\n const hideFeaturesByMarket = useMarketFlagsStore(\n (state) => state.flags.hideVeraFeaturesByMarket\n );\n\n const { loading, error, data, refetch } = useQuery(FETCH_ROUTINES_PAGE, {\n variables: { locale },\n });\n\n useEffect(() => {\n setRefresh(!refresh);\n }, [localizationStore]);\n\n const routinesPageData = data ? data.result.items[0] : {};\n if (error || !routinesPageData) {\n const errorCode = error?.graphQLErrors[0]?.extensions?.errors[0]?.code;\n\n return (\n <SafeAreaView style={styles.container}>\n <ErrorScreen errorCode={errorCode} refresh={() => refetch()} />\n </SafeAreaView>\n );\n }\n if (loading) {\n return (\n <SafeAreaView\n style={styles.container}\n {...accessibility('routine-container-loading')}\n >\n <ActivityIndicator\n size=\"large\"\n {...accessibility('routine-activity-indicator')}\n />\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView style={styles.container} testID=\"routineStack\">\n <VeraHeader\n left={<Logo accessibilityLabel=\"logo\" />}\n right={\n <>\n <HeaderAccount />\n {!hideFeaturesByMarket && <HeaderCart />}\n </>\n }\n title={routinesPageData.title}\n {...accessibility('routine-activity-indicator')}\n />\n <View style={styles.routinesContainer}>\n {routinesPageData && (\n <>\n <Text style={styles.sortListText}>\n {routinesPageData.sort_list_label}\n </Text>\n <FlatList\n data={routinesPageData.routines}\n renderItem={({ item, index }) => (\n <ListItem index={index} item={item} key={index} />\n )}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ paddingHorizontal: 15 }}\n />\n </>\n )}\n </View>\n </SafeAreaView>\n );\n};\n\nfunction RoutineStack() {\n const navigation = useNavigation();\n useEffect(() => {\n const unsubscribe = navigation.addListener('focus', () => {\n Logger.info('User navigated to the RoutineStack page.');\n });\n return unsubscribe;\n }, [navigation]);\n\n return (\n <Stack.Navigator initialRouteName=\"Routines\">\n <Stack.Screen\n name=\"Routines\"\n component={Routines}\n options={{ headerShown: false }}\n />\n <Stack.Screen\n name=\"RoutineDetails\"\n component={RoutineDetails}\n options={{ headerShown: false }}\n />\n </Stack.Navigator>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.white,\n },\n routinesContainer: {\n backgroundColor: colors.primaryGray,\n flex: 1,\n paddingTop: 10,\n },\n listContainer: {\n flexDirection: 'column',\n paddingHorizontal: 15,\n paddingVertical: 10,\n },\n sectionHeader: {\n textTransform: 'uppercase',\n fontWeight: '600',\n fontSize: 14,\n marginTop: 20,\n paddingHorizontal: 15,\n marginBottom: 5,\n },\n item: {\n margin: 10,\n borderRadius: 14,\n },\n itemContainer: {\n backgroundColor: 'transparent',\n flex: 1,\n marginBottom: 10,\n },\n itemTextContainer: {\n backgroundColor: colors.white,\n paddingTop: 20,\n paddingBottom: 10,\n },\n itemPhoto: {\n width: '100%',\n minHeight: 160,\n },\n productPhoto: {\n margin: 2,\n width: 40,\n height: 40,\n borderRadius: 50,\n borderColor: '#EDEDED',\n borderWidth: 1,\n },\n itemTitleContainer: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 15,\n },\n itemTextTitle: {\n color: colors.primaryBlack,\n fontWeight: '600',\n fontSize: 18,\n },\n itemText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n fontSize: 12,\n letterSpacing: 0.05,\n paddingBottom: 5,\n textTransform: 'uppercase',\n },\n itemTextSteps: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n },\n sortListText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n textAlign: 'right',\n marginRight: 10,\n letterSpacing: 0.5,\n paddingVertical: 10,\n paddingRight: 20,\n },\n});\n\nexport { RoutineStack };\n"],"mappings":";;;;;;;AAAA;AACA;AAUA;AACA;AACA;AAQA;AAKA;AACA;AACA;AACA;AACA;AAA+D;AAAA;AAAA;AAAA;AAE/D,MAAMA,KAAK,GAAG,IAAAC,2BAAoB,GAAE;AAC7B,MAAMC,mBAAmB,GAAG,IAAAC,WAAG,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAC;AAEF,MAAMC,QAAQ,GAAG,QAAqB;EAAA;EAAA,IAApB;IAAEC,IAAI;IAAEC;EAAM,CAAC;EAC/B,MAAMC,UAAU,GAAG,IAAAC,qBAAa,GAA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,CAACsB,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE;EACjB,CAAC;EACDtB,YAAY,EAAE;IACZoC,KAAK,EAAErB,gBAAM,CAACsB,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE,WAAW;IAC1BiB,SAAS,EAAE,OAAO;IAClBC,WAAW,EAAE,EAAE;IACfF,aAAa,EAAE,GAAG;IAClBlB,eAAe,EAAE,EAAE;IACnBqB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["Stack","createStackNavigator","FETCH_ROUTINES_PAGE","gql","ListItem","item","index","navigation","useNavigation","handleOnPress","navigate","styles","itemContainer","accessibility","uri","routine_imageConnection","edges","node","url","itemPhoto","itemTextContainer","itemTitleContainer","itemTextTitle","routine_title","itemTextSteps","steps","length","routine_step_label","listContainer","itemText","products_used_label","products","product_imageConnection","productPhoto","Routines","localeState","localization","useLocalization","locale","refresh","setRefresh","useState","getLocalization","LocalizationFormat","CONTENT_STACK","hideFeaturesByMarket","useMarketFlagsStore","state","flags","hideVeraFeaturesByMarket","loading","error","data","refetch","useQuery","variables","useEffect","routinesPageData","result","items","errorCode","graphQLErrors","extensions","errors","code","container","title","routinesContainer","sortListText","sort_list_label","routines","paddingHorizontal","RoutineStack","unsubscribe","addListener","Logger","info","headerShown","RoutineDetails","StyleSheet","create","flex","backgroundColor","colors","white","primaryGray","paddingTop","flexDirection","paddingVertical","sectionHeader","textTransform","fontWeight","fontSize","marginTop","marginBottom","margin","borderRadius","paddingBottom","width","minHeight","height","borderColor","borderWidth","justifyContent","color","primaryBlack","letterSpacing","textAlign","marginRight","paddingRight"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n FlatList,\n Image,\n SafeAreaView,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n ActivityIndicator,\n} from 'react-native';\nimport { gql, useQuery } from '@apollo/client';\nimport { useNavigation } from '@react-navigation/native';\nimport {\n VeraHeader,\n Logo,\n HeaderCart,\n HeaderAccount,\n colors,\n ErrorScreen,\n} from '@ns/mobile-ui';\nimport { localization, useMarketFlagsStore } from '@nuskin/utils-module';\nimport RoutineDetails from './RoutineDetails';\nimport { Logger } from '@nuskin/mobile-logging';\nimport { accessibility } from './helpers/Accessibility';\nimport { createStackNavigator } from '@react-navigation/stack';\n\nconst Stack = createStackNavigator();\nexport const FETCH_ROUTINES_PAGE = gql`\n query fetchAllHomePages($locale: String) {\n result: all_routine(fallback_locale: true, locale: $locale) {\n items {\n products_used_label\n sort_list_label\n title\n routines {\n products {\n product_name\n product_category\n product_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n }\n products_used_label\n routine_title\n routine_subtitle\n routines_description\n routine_step_label\n reference\n routine_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n steps {\n imageConnection {\n edges {\n node {\n url\n }\n }\n }\n step_sub_description\n step_title\n step_description\n style\n image_title\n image_description\n }\n }\n }\n }\n }\n`;\n\nconst ListItem = ({ item, index }) => {\n const navigation = useNavigation();\n const handleOnPress = () => {\n navigation.navigate('RoutineDetails' as never, item as never);\n };\n return (\n <View style={styles.itemContainer}>\n <TouchableOpacity onPress={handleOnPress}>\n <View>\n <Image\n {...accessibility(`list-item-${index}`)}\n source={{\n uri: item.routine_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.itemPhoto}\n />\n </View>\n <View style={styles.itemTextContainer}>\n <View style={styles.itemTitleContainer}>\n <Text\n {...accessibility(`list-item-title-${index}`)}\n style={styles.itemTextTitle}\n >\n {item.routine_title}\n </Text>\n <Text style={styles.itemTextSteps}>\n {item.steps.length} {item.routine_step_label}\n </Text>\n </View>\n <View style={styles.listContainer}>\n <Text style={styles.itemText}>{item.products_used_label}</Text>\n <FlatList\n data={item.products}\n horizontal\n renderItem={({ item, index }) => (\n <Image\n key={index}\n {...accessibility(`list-item-product-${index}`)}\n source={{\n uri: item.product_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.productPhoto}\n resizeMode=\"contain\"\n />\n )}\n showsHorizontalScrollIndicator={false}\n />\n </View>\n </View>\n </TouchableOpacity>\n </View>\n );\n};\n\nconst Routines = () => {\n const localeState = localization.useLocalization().locale;\n const [refresh, setRefresh] = useState(false);\n const locale = localization.getLocalization(\n localization.LocalizationFormat.CONTENT_STACK\n );\n const hideFeaturesByMarket = useMarketFlagsStore(\n (state) => state.flags.hideVeraFeaturesByMarket\n );\n\n const { loading, error, data, refetch } = useQuery(FETCH_ROUTINES_PAGE, {\n variables: { locale },\n });\n\n useEffect(() => {\n setRefresh(!refresh);\n }, [localeState]);\n\n const routinesPageData = data ? data.result.items[0] : {};\n if (error || !routinesPageData) {\n const errorCode = error?.graphQLErrors[0]?.extensions?.errors[0]?.code;\n\n return (\n <SafeAreaView style={styles.container}>\n <ErrorScreen errorCode={errorCode} refresh={() => refetch()} />\n </SafeAreaView>\n );\n }\n if (loading) {\n return (\n <SafeAreaView\n style={styles.container}\n {...accessibility('routine-container-loading')}\n >\n <ActivityIndicator\n size=\"large\"\n {...accessibility('routine-activity-indicator')}\n />\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView style={styles.container} testID=\"routineStack\">\n <VeraHeader\n left={<Logo accessibilityLabel=\"logo\" />}\n right={\n <>\n <HeaderAccount />\n {!hideFeaturesByMarket && <HeaderCart />}\n </>\n }\n title={routinesPageData.title}\n {...accessibility('routine-activity-indicator')}\n />\n <View style={styles.routinesContainer}>\n {routinesPageData && (\n <>\n <Text style={styles.sortListText}>\n {routinesPageData.sort_list_label}\n </Text>\n <FlatList\n data={routinesPageData.routines}\n renderItem={({ item, index }) => (\n <ListItem index={index} item={item} key={index} />\n )}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ paddingHorizontal: 15 }}\n />\n </>\n )}\n </View>\n </SafeAreaView>\n );\n};\n\nfunction RoutineStack() {\n const navigation = useNavigation();\n useEffect(() => {\n const unsubscribe = navigation.addListener('focus', () => {\n Logger.info('User navigated to the RoutineStack page.');\n });\n return unsubscribe;\n }, [navigation]);\n\n return (\n <Stack.Navigator initialRouteName=\"Routines\">\n <Stack.Screen\n name=\"Routines\"\n component={Routines}\n options={{ headerShown: false }}\n />\n <Stack.Screen\n name=\"RoutineDetails\"\n component={RoutineDetails}\n options={{ headerShown: false }}\n />\n </Stack.Navigator>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.white,\n },\n routinesContainer: {\n backgroundColor: colors.primaryGray,\n flex: 1,\n paddingTop: 10,\n },\n listContainer: {\n flexDirection: 'column',\n paddingHorizontal: 15,\n paddingVertical: 10,\n },\n sectionHeader: {\n textTransform: 'uppercase',\n fontWeight: '600',\n fontSize: 14,\n marginTop: 20,\n paddingHorizontal: 15,\n marginBottom: 5,\n },\n item: {\n margin: 10,\n borderRadius: 14,\n },\n itemContainer: {\n backgroundColor: 'transparent',\n flex: 1,\n marginBottom: 10,\n },\n itemTextContainer: {\n backgroundColor: colors.white,\n paddingTop: 20,\n paddingBottom: 10,\n },\n itemPhoto: {\n width: '100%',\n minHeight: 160,\n },\n productPhoto: {\n margin: 2,\n width: 40,\n height: 40,\n borderRadius: 50,\n borderColor: '#EDEDED',\n borderWidth: 1,\n },\n itemTitleContainer: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 15,\n },\n itemTextTitle: {\n color: colors.primaryBlack,\n fontWeight: '600',\n fontSize: 18,\n },\n itemText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n fontSize: 12,\n letterSpacing: 0.05,\n paddingBottom: 5,\n textTransform: 'uppercase',\n },\n itemTextSteps: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n },\n sortListText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n textAlign: 'right',\n marginRight: 10,\n letterSpacing: 0.5,\n paddingVertical: 10,\n paddingRight: 20,\n },\n});\n\nexport { RoutineStack };\n"],"mappings":";;;;;;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E,EAAE;IACVJ,YAAY,EAAE,EAAE;IAChBK,WAAW,EAAE,SAAS;IACtBC,WAAW,EAAE;EACf,CAAC;EACDjF,kBAAkB,EAAE;IAClBkE,aAAa,EAAE,KAAK;IACpBgB,cAAc,EAAE,eAAe;IAC/BhC,iBAAiB,EAAE;EACrB,CAAC;EACDjD,aAAa,EAAE;IACbkF,KAAK,EAAErB,gBAAM,CAACsB,YAAY;IAC1Bd,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACD/D,QAAQ,EAAE;IACR2E,KAAK,EAAErB,gBAAM,CAACsB,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBC,QAAQ,EAAE,EAAE;IACZc,aAAa,EAAE,IAAI;IACnBT,aAAa,EAAE,CAAC;IAChBP,aAAa,EAAE;EACjB,CAAC;EACDlE,aAAa,EAAE;IACbgF,KAAK,EAAErB,gBAAM,CAACsB,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE;EACjB,CAAC;EACDtB,YAAY,EAAE;IACZoC,KAAK,EAAErB,gBAAM,CAACsB,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE,WAAW;IAC1BiB,SAAS,EAAE,OAAO;IAClBC,WAAW,EAAE,EAAE;IACfF,aAAa,EAAE,GAAG;IAClBlB,eAAe,EAAE,EAAE;IACnBqB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}
@@ -4,8 +4,7 @@ import { FlatList, Image, SafeAreaView, StyleSheet, Text, TouchableOpacity, View
4
4
  import { gql, useQuery } from '@apollo/client';
5
5
  import { useNavigation } from '@react-navigation/native';
6
6
  import { VeraHeader, Logo, HeaderCart, HeaderAccount, colors, ErrorScreen } from '@ns/mobile-ui';
7
- import { localization, localizationState, useMarketFlagsStore } from '@nuskin/utils-module';
8
- import { useSnapshot } from 'valtio';
7
+ import { localization, useMarketFlagsStore } from '@nuskin/utils-module';
9
8
  import RoutineDetails from './RoutineDetails';
10
9
  import { Logger } from '@nuskin/mobile-logging';
11
10
  import { accessibility } from './helpers/Accessibility';
@@ -117,7 +116,7 @@ const ListItem = _ref => {
117
116
  })))));
118
117
  };
119
118
  const Routines = () => {
120
- const localizationStore = useSnapshot(localizationState);
119
+ const localeState = localization.useLocalization().locale;
121
120
  const [refresh, setRefresh] = useState(false);
122
121
  const locale = localization.getLocalization(localization.LocalizationFormat.CONTENT_STACK);
123
122
  const hideFeaturesByMarket = useMarketFlagsStore(state => state.flags.hideVeraFeaturesByMarket);
@@ -133,7 +132,7 @@ const Routines = () => {
133
132
  });
134
133
  useEffect(() => {
135
134
  setRefresh(!refresh);
136
- }, [localizationStore]);
135
+ }, [localeState]);
137
136
  const routinesPageData = data ? data.result.items[0] : {};
138
137
  if (error || !routinesPageData) {
139
138
  var _error$graphQLErrors$, _error$graphQLErrors$2, _error$graphQLErrors$3;
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useState","FlatList","Image","SafeAreaView","StyleSheet","Text","TouchableOpacity","View","ActivityIndicator","gql","useQuery","useNavigation","VeraHeader","Logo","HeaderCart","HeaderAccount","colors","ErrorScreen","localization","localizationState","useMarketFlagsStore","useSnapshot","RoutineDetails","Logger","accessibility","createStackNavigator","Stack","FETCH_ROUTINES_PAGE","ListItem","item","index","navigation","handleOnPress","navigate","styles","itemContainer","uri","routine_imageConnection","edges","node","url","itemPhoto","itemTextContainer","itemTitleContainer","itemTextTitle","routine_title","itemTextSteps","steps","length","routine_step_label","listContainer","itemText","products_used_label","products","product_imageConnection","productPhoto","Routines","localizationStore","refresh","setRefresh","locale","getLocalization","LocalizationFormat","CONTENT_STACK","hideFeaturesByMarket","state","flags","hideVeraFeaturesByMarket","loading","error","data","refetch","variables","routinesPageData","result","items","errorCode","graphQLErrors","extensions","errors","code","container","title","routinesContainer","sortListText","sort_list_label","routines","paddingHorizontal","RoutineStack","unsubscribe","addListener","info","headerShown","create","flex","backgroundColor","white","primaryGray","paddingTop","flexDirection","paddingVertical","sectionHeader","textTransform","fontWeight","fontSize","marginTop","marginBottom","margin","borderRadius","paddingBottom","width","minHeight","height","borderColor","borderWidth","justifyContent","color","primaryBlack","letterSpacing","textAlign","marginRight","paddingRight"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n FlatList,\n Image,\n SafeAreaView,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n ActivityIndicator,\n} from 'react-native';\nimport { gql, useQuery } from '@apollo/client';\nimport { useNavigation } from '@react-navigation/native';\nimport {\n VeraHeader,\n Logo,\n HeaderCart,\n HeaderAccount,\n colors,\n ErrorScreen,\n} from '@ns/mobile-ui';\nimport {\n localization,\n localizationState,\n useMarketFlagsStore,\n} from '@nuskin/utils-module';\nimport { useSnapshot } from 'valtio';\nimport RoutineDetails from './RoutineDetails';\nimport { Logger } from '@nuskin/mobile-logging';\nimport { accessibility } from './helpers/Accessibility';\nimport { createStackNavigator } from '@react-navigation/stack';\n\nconst Stack = createStackNavigator();\nexport const FETCH_ROUTINES_PAGE = gql`\n query fetchAllHomePages($locale: String) {\n result: all_routine(fallback_locale: true, locale: $locale) {\n items {\n products_used_label\n sort_list_label\n title\n routines {\n products {\n product_name\n product_category\n product_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n }\n products_used_label\n routine_title\n routine_subtitle\n routines_description\n routine_step_label\n reference\n routine_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n steps {\n imageConnection {\n edges {\n node {\n url\n }\n }\n }\n step_sub_description\n step_title\n step_description\n style\n image_title\n image_description\n }\n }\n }\n }\n }\n`;\n\nconst ListItem = ({ item, index }) => {\n const navigation = useNavigation();\n const handleOnPress = () => {\n navigation.navigate('RoutineDetails' as never, item as never);\n };\n return (\n <View style={styles.itemContainer}>\n <TouchableOpacity onPress={handleOnPress}>\n <View>\n <Image\n {...accessibility(`list-item-${index}`)}\n source={{\n uri: item.routine_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.itemPhoto}\n />\n </View>\n <View style={styles.itemTextContainer}>\n <View style={styles.itemTitleContainer}>\n <Text\n {...accessibility(`list-item-title-${index}`)}\n style={styles.itemTextTitle}\n >\n {item.routine_title}\n </Text>\n <Text style={styles.itemTextSteps}>\n {item.steps.length} {item.routine_step_label}\n </Text>\n </View>\n <View style={styles.listContainer}>\n <Text style={styles.itemText}>{item.products_used_label}</Text>\n <FlatList\n data={item.products}\n horizontal\n renderItem={({ item, index }) => (\n <Image\n key={index}\n {...accessibility(`list-item-product-${index}`)}\n source={{\n uri: item.product_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.productPhoto}\n resizeMode=\"contain\"\n />\n )}\n showsHorizontalScrollIndicator={false}\n />\n </View>\n </View>\n </TouchableOpacity>\n </View>\n );\n};\n\nconst Routines = () => {\n const localizationStore = useSnapshot(localizationState);\n const [refresh, setRefresh] = useState(false);\n const locale = localization.getLocalization(\n localization.LocalizationFormat.CONTENT_STACK\n );\n const hideFeaturesByMarket = useMarketFlagsStore(\n (state) => state.flags.hideVeraFeaturesByMarket\n );\n\n const { loading, error, data, refetch } = useQuery(FETCH_ROUTINES_PAGE, {\n variables: { locale },\n });\n\n useEffect(() => {\n setRefresh(!refresh);\n }, [localizationStore]);\n\n const routinesPageData = data ? data.result.items[0] : {};\n if (error || !routinesPageData) {\n const errorCode = error?.graphQLErrors[0]?.extensions?.errors[0]?.code;\n\n return (\n <SafeAreaView style={styles.container}>\n <ErrorScreen errorCode={errorCode} refresh={() => refetch()} />\n </SafeAreaView>\n );\n }\n if (loading) {\n return (\n <SafeAreaView\n style={styles.container}\n {...accessibility('routine-container-loading')}\n >\n <ActivityIndicator\n size=\"large\"\n {...accessibility('routine-activity-indicator')}\n />\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView style={styles.container} testID=\"routineStack\">\n <VeraHeader\n left={<Logo accessibilityLabel=\"logo\" />}\n right={\n <>\n <HeaderAccount />\n {!hideFeaturesByMarket && <HeaderCart />}\n </>\n }\n title={routinesPageData.title}\n {...accessibility('routine-activity-indicator')}\n />\n <View style={styles.routinesContainer}>\n {routinesPageData && (\n <>\n <Text style={styles.sortListText}>\n {routinesPageData.sort_list_label}\n </Text>\n <FlatList\n data={routinesPageData.routines}\n renderItem={({ item, index }) => (\n <ListItem index={index} item={item} key={index} />\n )}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ paddingHorizontal: 15 }}\n />\n </>\n )}\n </View>\n </SafeAreaView>\n );\n};\n\nfunction RoutineStack() {\n const navigation = useNavigation();\n useEffect(() => {\n const unsubscribe = navigation.addListener('focus', () => {\n Logger.info('User navigated to the RoutineStack page.');\n });\n return unsubscribe;\n }, [navigation]);\n\n return (\n <Stack.Navigator initialRouteName=\"Routines\">\n <Stack.Screen\n name=\"Routines\"\n component={Routines}\n options={{ headerShown: false }}\n />\n <Stack.Screen\n name=\"RoutineDetails\"\n component={RoutineDetails}\n options={{ headerShown: false }}\n />\n </Stack.Navigator>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.white,\n },\n routinesContainer: {\n backgroundColor: colors.primaryGray,\n flex: 1,\n paddingTop: 10,\n },\n listContainer: {\n flexDirection: 'column',\n paddingHorizontal: 15,\n paddingVertical: 10,\n },\n sectionHeader: {\n textTransform: 'uppercase',\n fontWeight: '600',\n fontSize: 14,\n marginTop: 20,\n paddingHorizontal: 15,\n marginBottom: 5,\n },\n item: {\n margin: 10,\n borderRadius: 14,\n },\n itemContainer: {\n backgroundColor: 'transparent',\n flex: 1,\n marginBottom: 10,\n },\n itemTextContainer: {\n backgroundColor: colors.white,\n paddingTop: 20,\n paddingBottom: 10,\n },\n itemPhoto: {\n width: '100%',\n minHeight: 160,\n },\n productPhoto: {\n margin: 2,\n width: 40,\n height: 40,\n borderRadius: 50,\n borderColor: '#EDEDED',\n borderWidth: 1,\n },\n itemTitleContainer: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 15,\n },\n itemTextTitle: {\n color: colors.primaryBlack,\n fontWeight: '600',\n fontSize: 18,\n },\n itemText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n fontSize: 12,\n letterSpacing: 0.05,\n paddingBottom: 5,\n textTransform: 'uppercase',\n },\n itemTextSteps: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n },\n sortListText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n textAlign: 'right',\n marginRight: 10,\n letterSpacing: 0.5,\n paddingVertical: 10,\n paddingRight: 20,\n },\n});\n\nexport { RoutineStack };\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SACEC,QAAQ,EACRC,KAAK,EACLC,YAAY,EACZC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,EACJC,iBAAiB,QACZ,cAAc;AACrB,SAASC,GAAG,EAAEC,QAAQ,QAAQ,gBAAgB;AAC9C,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SACEC,UAAU,EACVC,IAAI,EACJC,UAAU,EACVC,aAAa,EACbC,MAAM,EACNC,WAAW,QACN,eAAe;AACtB,SACEC,YAAY,EACZC,iBAAiB,EACjBC,mBAAmB,QACd,sBAAsB;AAC7B,SAASC,WAAW,QAAQ,QAAQ;AACpC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,MAAMC,KAAK,GAAGD,oBAAoB,EAAE;AACpC,OAAO,MAAME,mBAAmB,GAAGlB,GAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,CAAC;IAChBP,aAAa,EAAE;EACjB,CAAC;EACDxD,aAAa,EAAE;IACbsE,KAAK,EAAEpG,MAAM,CAACqG,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE;EACjB,CAAC;EACDlB,YAAY,EAAE;IACZgC,KAAK,EAAEpG,MAAM,CAACqG,YAAY;IAC1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE,WAAW;IAC1BiB,SAAS,EAAE,OAAO;IAClBC,WAAW,EAAE,EAAE;IACfF,aAAa,EAAE,GAAG;IAClBlB,eAAe,EAAE,EAAE;IACnBqB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,SAASjC,YAAY"}
1
+ {"version":3,"names":["React","useEffect","useState","FlatList","Image","SafeAreaView","StyleSheet","Text","TouchableOpacity","View","ActivityIndicator","gql","useQuery","useNavigation","VeraHeader","Logo","HeaderCart","HeaderAccount","colors","ErrorScreen","localization","useMarketFlagsStore","RoutineDetails","Logger","accessibility","createStackNavigator","Stack","FETCH_ROUTINES_PAGE","ListItem","item","index","navigation","handleOnPress","navigate","styles","itemContainer","uri","routine_imageConnection","edges","node","url","itemPhoto","itemTextContainer","itemTitleContainer","itemTextTitle","routine_title","itemTextSteps","steps","length","routine_step_label","listContainer","itemText","products_used_label","products","product_imageConnection","productPhoto","Routines","localeState","useLocalization","locale","refresh","setRefresh","getLocalization","LocalizationFormat","CONTENT_STACK","hideFeaturesByMarket","state","flags","hideVeraFeaturesByMarket","loading","error","data","refetch","variables","routinesPageData","result","items","errorCode","graphQLErrors","extensions","errors","code","container","title","routinesContainer","sortListText","sort_list_label","routines","paddingHorizontal","RoutineStack","unsubscribe","addListener","info","headerShown","create","flex","backgroundColor","white","primaryGray","paddingTop","flexDirection","paddingVertical","sectionHeader","textTransform","fontWeight","fontSize","marginTop","marginBottom","margin","borderRadius","paddingBottom","width","minHeight","height","borderColor","borderWidth","justifyContent","color","primaryBlack","letterSpacing","textAlign","marginRight","paddingRight"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n FlatList,\n Image,\n SafeAreaView,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n ActivityIndicator,\n} from 'react-native';\nimport { gql, useQuery } from '@apollo/client';\nimport { useNavigation } from '@react-navigation/native';\nimport {\n VeraHeader,\n Logo,\n HeaderCart,\n HeaderAccount,\n colors,\n ErrorScreen,\n} from '@ns/mobile-ui';\nimport { localization, useMarketFlagsStore } from '@nuskin/utils-module';\nimport RoutineDetails from './RoutineDetails';\nimport { Logger } from '@nuskin/mobile-logging';\nimport { accessibility } from './helpers/Accessibility';\nimport { createStackNavigator } from '@react-navigation/stack';\n\nconst Stack = createStackNavigator();\nexport const FETCH_ROUTINES_PAGE = gql`\n query fetchAllHomePages($locale: String) {\n result: all_routine(fallback_locale: true, locale: $locale) {\n items {\n products_used_label\n sort_list_label\n title\n routines {\n products {\n product_name\n product_category\n product_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n }\n products_used_label\n routine_title\n routine_subtitle\n routines_description\n routine_step_label\n reference\n routine_imageConnection {\n edges {\n node {\n url\n }\n }\n }\n steps {\n imageConnection {\n edges {\n node {\n url\n }\n }\n }\n step_sub_description\n step_title\n step_description\n style\n image_title\n image_description\n }\n }\n }\n }\n }\n`;\n\nconst ListItem = ({ item, index }) => {\n const navigation = useNavigation();\n const handleOnPress = () => {\n navigation.navigate('RoutineDetails' as never, item as never);\n };\n return (\n <View style={styles.itemContainer}>\n <TouchableOpacity onPress={handleOnPress}>\n <View>\n <Image\n {...accessibility(`list-item-${index}`)}\n source={{\n uri: item.routine_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.itemPhoto}\n />\n </View>\n <View style={styles.itemTextContainer}>\n <View style={styles.itemTitleContainer}>\n <Text\n {...accessibility(`list-item-title-${index}`)}\n style={styles.itemTextTitle}\n >\n {item.routine_title}\n </Text>\n <Text style={styles.itemTextSteps}>\n {item.steps.length} {item.routine_step_label}\n </Text>\n </View>\n <View style={styles.listContainer}>\n <Text style={styles.itemText}>{item.products_used_label}</Text>\n <FlatList\n data={item.products}\n horizontal\n renderItem={({ item, index }) => (\n <Image\n key={index}\n {...accessibility(`list-item-product-${index}`)}\n source={{\n uri: item.product_imageConnection?.edges[0]?.node?.url,\n }}\n style={styles.productPhoto}\n resizeMode=\"contain\"\n />\n )}\n showsHorizontalScrollIndicator={false}\n />\n </View>\n </View>\n </TouchableOpacity>\n </View>\n );\n};\n\nconst Routines = () => {\n const localeState = localization.useLocalization().locale;\n const [refresh, setRefresh] = useState(false);\n const locale = localization.getLocalization(\n localization.LocalizationFormat.CONTENT_STACK\n );\n const hideFeaturesByMarket = useMarketFlagsStore(\n (state) => state.flags.hideVeraFeaturesByMarket\n );\n\n const { loading, error, data, refetch } = useQuery(FETCH_ROUTINES_PAGE, {\n variables: { locale },\n });\n\n useEffect(() => {\n setRefresh(!refresh);\n }, [localeState]);\n\n const routinesPageData = data ? data.result.items[0] : {};\n if (error || !routinesPageData) {\n const errorCode = error?.graphQLErrors[0]?.extensions?.errors[0]?.code;\n\n return (\n <SafeAreaView style={styles.container}>\n <ErrorScreen errorCode={errorCode} refresh={() => refetch()} />\n </SafeAreaView>\n );\n }\n if (loading) {\n return (\n <SafeAreaView\n style={styles.container}\n {...accessibility('routine-container-loading')}\n >\n <ActivityIndicator\n size=\"large\"\n {...accessibility('routine-activity-indicator')}\n />\n </SafeAreaView>\n );\n }\n\n return (\n <SafeAreaView style={styles.container} testID=\"routineStack\">\n <VeraHeader\n left={<Logo accessibilityLabel=\"logo\" />}\n right={\n <>\n <HeaderAccount />\n {!hideFeaturesByMarket && <HeaderCart />}\n </>\n }\n title={routinesPageData.title}\n {...accessibility('routine-activity-indicator')}\n />\n <View style={styles.routinesContainer}>\n {routinesPageData && (\n <>\n <Text style={styles.sortListText}>\n {routinesPageData.sort_list_label}\n </Text>\n <FlatList\n data={routinesPageData.routines}\n renderItem={({ item, index }) => (\n <ListItem index={index} item={item} key={index} />\n )}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ paddingHorizontal: 15 }}\n />\n </>\n )}\n </View>\n </SafeAreaView>\n );\n};\n\nfunction RoutineStack() {\n const navigation = useNavigation();\n useEffect(() => {\n const unsubscribe = navigation.addListener('focus', () => {\n Logger.info('User navigated to the RoutineStack page.');\n });\n return unsubscribe;\n }, [navigation]);\n\n return (\n <Stack.Navigator initialRouteName=\"Routines\">\n <Stack.Screen\n name=\"Routines\"\n component={Routines}\n options={{ headerShown: false }}\n />\n <Stack.Screen\n name=\"RoutineDetails\"\n component={RoutineDetails}\n options={{ headerShown: false }}\n />\n </Stack.Navigator>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: colors.white,\n },\n routinesContainer: {\n backgroundColor: colors.primaryGray,\n flex: 1,\n paddingTop: 10,\n },\n listContainer: {\n flexDirection: 'column',\n paddingHorizontal: 15,\n paddingVertical: 10,\n },\n sectionHeader: {\n textTransform: 'uppercase',\n fontWeight: '600',\n fontSize: 14,\n marginTop: 20,\n paddingHorizontal: 15,\n marginBottom: 5,\n },\n item: {\n margin: 10,\n borderRadius: 14,\n },\n itemContainer: {\n backgroundColor: 'transparent',\n flex: 1,\n marginBottom: 10,\n },\n itemTextContainer: {\n backgroundColor: colors.white,\n paddingTop: 20,\n paddingBottom: 10,\n },\n itemPhoto: {\n width: '100%',\n minHeight: 160,\n },\n productPhoto: {\n margin: 2,\n width: 40,\n height: 40,\n borderRadius: 50,\n borderColor: '#EDEDED',\n borderWidth: 1,\n },\n itemTitleContainer: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 15,\n },\n itemTextTitle: {\n color: colors.primaryBlack,\n fontWeight: '600',\n fontSize: 18,\n },\n itemText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n fontSize: 12,\n letterSpacing: 0.05,\n paddingBottom: 5,\n textTransform: 'uppercase',\n },\n itemTextSteps: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n },\n sortListText: {\n color: colors.primaryBlack,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n textAlign: 'right',\n marginRight: 10,\n letterSpacing: 0.5,\n paddingVertical: 10,\n paddingRight: 20,\n },\n});\n\nexport { RoutineStack };\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SACEC,QAAQ,EACRC,KAAK,EACLC,YAAY,EACZC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,EACJC,iBAAiB,QACZ,cAAc;AACrB,SAASC,GAAG,EAAEC,QAAQ,QAAQ,gBAAgB;AAC9C,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SACEC,UAAU,EACVC,IAAI,EACJC,UAAU,EACVC,aAAa,EACbC,MAAM,EACNC,WAAW,QACN,eAAe;AACtB,SAASC,YAAY,EAAEC,mBAAmB,QAAQ,sBAAsB;AACxE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,MAAMC,KAAK,GAAGD,oBAAoB,EAAE;AACpC,OAAO,MAAME,mBAAmB,GAAGhB,GAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMiB,QAAQ,GAAG,QAAqB;EAAA;EAAA,IAApB;IAAEC,IAAI;IAAEC;EAAM,CAAC;EAC/B,MAAMC,UAAU,GAAGlB,aAAa,EAAE;EAClC,MAAMmB,aAAa,GAAG,MAAM;IAC1BD,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1Bd,UAAU,EAAE,MAAM;IAClBD,aAAa,EAAE,WAAW;IAC1BiB,SAAS,EAAE,OAAO;IAClBC,WAAW,EAAE,EAAE;IACfF,aAAa,EAAE,GAAG;IAClBlB,eAAe,EAAE,EAAE;IACnBqB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,SAASjC,YAAY"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuskin/routine-feature",
3
3
  "private": false,
4
- "version": "2.0.2",
4
+ "version": "3.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://code.tls.nuskin.io/ns-am/mobile/applications/luna-and-sol/shared2.git",
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@apollo/client": "^3.7.4",
37
37
  "@react-navigation/stack": "^6.2.2",
38
- "@ns/mobile-ui": "^1.3.41",
39
- "@nuskin/utils-module": "^1.1.5",
38
+ "@ns/mobile-ui": "^1.3.42",
39
+ "@nuskin/utils-module": "^3.0.0",
40
40
  "react-native-linear-gradient": "^2.5.6",
41
41
  "@nuskin/mobile-logging": "^1.0.3"
42
42
  },
@@ -139,10 +139,10 @@
139
139
  ]
140
140
  ]
141
141
  },
142
- "commithash": "b68bce48fa3f0d300881a6a3a74e532cabcdc30b",
142
+ "commithash": "d107e502743ba4fd91dccdebfe6d4082a957be37",
143
143
  "author": {
144
- "name": "Camila Urquizo",
145
- "email": "curquizo@nuskin.com",
146
- "url": "https://code.tls.nuskin.io/curquizo"
144
+ "name": "Andres Caycho Tiznado",
145
+ "email": "acaycho@nuskin.onmicrosoft.com",
146
+ "url": "https://code.tls.nuskin.io/acaycho1"
147
147
  }
148
148
  }
package/src/index.tsx CHANGED
@@ -19,12 +19,7 @@ import {
19
19
  colors,
20
20
  ErrorScreen,
21
21
  } from '@ns/mobile-ui';
22
- import {
23
- localization,
24
- localizationState,
25
- useMarketFlagsStore,
26
- } from '@nuskin/utils-module';
27
- import { useSnapshot } from 'valtio';
22
+ import { localization, useMarketFlagsStore } from '@nuskin/utils-module';
28
23
  import RoutineDetails from './RoutineDetails';
29
24
  import { Logger } from '@nuskin/mobile-logging';
30
25
  import { accessibility } from './helpers/Accessibility';
@@ -139,7 +134,7 @@ const ListItem = ({ item, index }) => {
139
134
  };
140
135
 
141
136
  const Routines = () => {
142
- const localizationStore = useSnapshot(localizationState);
137
+ const localeState = localization.useLocalization().locale;
143
138
  const [refresh, setRefresh] = useState(false);
144
139
  const locale = localization.getLocalization(
145
140
  localization.LocalizationFormat.CONTENT_STACK
@@ -154,7 +149,7 @@ const Routines = () => {
154
149
 
155
150
  useEffect(() => {
156
151
  setRefresh(!refresh);
157
- }, [localizationStore]);
152
+ }, [localeState]);
158
153
 
159
154
  const routinesPageData = data ? data.result.items[0] : {};
160
155
  if (error || !routinesPageData) {