@nuskin/routine-feature 1.0.0 → 2.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.
@@ -1,165 +1,192 @@
1
- import React, { useEffect } from 'react';
2
- import { FlatList, Image, SafeAreaView, SectionList, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
3
- import { createNativeStackNavigator } from '@nuskin/mobile-navigation';
4
- import { VeraHeader, Logo, HeaderCart } from '@ns/mobile-ui';
5
- const Stack = createNativeStackNavigator();
6
- const SECTIONS = [{
7
- title: 'My Routines',
8
- horizontal: true,
9
- data: [{
10
- key: '1',
11
- text: 'Card Title Onessssss',
12
- uri: 'https://picsum.photos/id/1/200'
13
- }, {
14
- key: '2',
15
- text: 'Card Title 2',
16
- uri: 'https://picsum.photos/id/10/200'
17
- }, {
18
- key: '3',
19
- text: 'Card Title 3',
20
- uri: 'https://picsum.photos/id/1002/200'
21
- }]
22
- }, {
23
- title: 'Featured Routines',
24
- horizontal: true,
25
- data: [{
26
- key: '1',
27
- text: 'Card Title 1',
28
- uri: 'https://picsum.photos/id/1011/200'
29
- }, {
30
- key: '2',
31
- text: 'Card Title 2',
32
- uri: 'https://picsum.photos/id/1012/200'
33
- }, {
34
- key: '3',
35
- text: 'Card Title 3',
36
- uri: 'https://picsum.photos/id/1013/200'
37
- }]
38
- }, {
39
- title: 'Suggested Routines',
40
- horizontal: true,
41
- data: [{
42
- key: '1',
43
- text: 'Card Title 1',
44
- uri: 'https://picsum.photos/id/1020/200'
45
- }, {
46
- key: '2',
47
- text: 'Card Title 2',
48
- uri: 'https://picsum.photos/id/1024/200'
49
- }, {
50
- key: '3',
51
- text: 'Card Title 3',
52
- uri: 'https://picsum.photos/id/1027/200'
53
- }]
54
- }];
55
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import React, { useEffect, useState } from 'react';
3
+ import { FlatList, Image, SafeAreaView, StyleSheet, Text, TouchableOpacity, View, ActivityIndicator } from 'react-native';
4
+ import { gql, useQuery } from '@apollo/client';
5
+ import { useNavigation } from '@react-navigation/native';
6
+ import { VeraHeader, Logo, HeaderCart, colors, ErrorScreen } from '@ns/mobile-ui';
7
+ import { localization, localizationState } from '@nuskin/utils-module';
8
+ import { useSnapshot } from 'valtio';
9
+ import RoutineDetails from './RoutineDetails';
10
+ import { Logger } from '@nuskin/mobile-logging';
11
+ import { accessibility } from './helpers/Accessibility';
12
+ import { createStackNavigator } from '@react-navigation/stack';
13
+ const Stack = createStackNavigator();
14
+ export const FETCH_ROUTINES_PAGE = gql`
15
+ query fetchAllHomePages($locale: String) {
16
+ result: all_routine(fallback_locale: true, locale: $locale) {
17
+ items {
18
+ products_used_label
19
+ sort_list_label
20
+ title
21
+ routines {
22
+ products {
23
+ product_name
24
+ product_category
25
+ product_imageConnection {
26
+ edges {
27
+ node {
28
+ url
29
+ }
30
+ }
31
+ }
32
+ }
33
+ products_used_label
34
+ routine_title
35
+ routines_description
36
+ routine_step_label
37
+ routine_imageConnection {
38
+ edges {
39
+ node {
40
+ url
41
+ }
42
+ }
43
+ }
44
+ steps {
45
+ imageConnection {
46
+ edges {
47
+ node {
48
+ url
49
+ }
50
+ }
51
+ }
52
+ step_sub_description
53
+ step_title
54
+ step_description
55
+ style
56
+ image_title
57
+ image_description
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ `;
56
64
  const ListItem = _ref => {
65
+ var _item$routine_imageCo, _item$routine_imageCo2, _item$routine_imageCo3;
57
66
  let {
58
- item,
59
- index
67
+ item
60
68
  } = _ref;
69
+ const navigation = useNavigation();
70
+ const handleOnPress = () => {
71
+ navigation.navigate('RoutineDetails', item);
72
+ };
61
73
  return /*#__PURE__*/React.createElement(View, {
62
- style: [styles.item, index === 0 ? {
63
- marginLeft: 0
64
- } : {}]
65
- }, /*#__PURE__*/React.createElement(Image, {
74
+ style: styles.itemContainer
75
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
76
+ onPress: handleOnPress
77
+ }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Image, {
66
78
  source: {
67
- uri: item.uri
79
+ uri: (_item$routine_imageCo = item.routine_imageConnection) === null || _item$routine_imageCo === void 0 ? void 0 : (_item$routine_imageCo2 = _item$routine_imageCo.edges[0]) === null || _item$routine_imageCo2 === void 0 ? void 0 : (_item$routine_imageCo3 = _item$routine_imageCo2.node) === null || _item$routine_imageCo3 === void 0 ? void 0 : _item$routine_imageCo3.url
68
80
  },
69
- style: styles.itemPhoto,
70
- resizeMode: "cover"
71
- }), /*#__PURE__*/React.createElement(Text, {
81
+ style: styles.itemPhoto
82
+ })), /*#__PURE__*/React.createElement(View, {
83
+ style: styles.itemTextContainer
84
+ }, /*#__PURE__*/React.createElement(View, {
85
+ style: styles.itemTitleContainer
86
+ }, /*#__PURE__*/React.createElement(Text, {
87
+ style: styles.itemTextTitle
88
+ }, item.routine_title), /*#__PURE__*/React.createElement(Text, {
89
+ style: styles.itemTextSteps
90
+ }, item.steps.length, " ", item.routine_step_label)), /*#__PURE__*/React.createElement(View, {
91
+ style: styles.listContainer
92
+ }, /*#__PURE__*/React.createElement(Text, {
72
93
  style: styles.itemText
73
- }, item.text));
94
+ }, item.products_used_label), /*#__PURE__*/React.createElement(FlatList, {
95
+ data: item.products,
96
+ horizontal: true,
97
+ renderItem: _ref2 => {
98
+ var _item$product_imageCo, _item$product_imageCo2, _item$product_imageCo3;
99
+ let {
100
+ item,
101
+ index
102
+ } = _ref2;
103
+ return /*#__PURE__*/React.createElement(Image, {
104
+ key: index,
105
+ source: {
106
+ uri: (_item$product_imageCo = item.product_imageConnection) === null || _item$product_imageCo === void 0 ? void 0 : (_item$product_imageCo2 = _item$product_imageCo.edges[0]) === null || _item$product_imageCo2 === void 0 ? void 0 : (_item$product_imageCo3 = _item$product_imageCo2.node) === null || _item$product_imageCo3 === void 0 ? void 0 : _item$product_imageCo3.url
107
+ },
108
+ style: styles.productPhoto,
109
+ resizeMode: "contain"
110
+ });
111
+ },
112
+ showsHorizontalScrollIndicator: false
113
+ })))));
74
114
  };
75
-
76
115
  const Routines = () => {
77
- const handleOnPress = () => {// console.log('onPress', section)
78
- };
79
-
116
+ const localizationStore = useSnapshot(localizationState);
117
+ const [refresh, setRefresh] = useState(false);
118
+ const locale = localization.getLocalization(localization.LocalizationFormat.CONTENT_STACK);
119
+ const {
120
+ loading,
121
+ error,
122
+ data,
123
+ refetch
124
+ } = useQuery(FETCH_ROUTINES_PAGE, {
125
+ variables: {
126
+ locale
127
+ }
128
+ });
129
+ useEffect(() => {
130
+ setRefresh(!refresh);
131
+ }, [localizationStore]);
132
+ const routinesPageData = data ? data.result.items[0] : {};
133
+ if (error || !routinesPageData) {
134
+ var _error$graphQLErrors$, _error$graphQLErrors$2, _error$graphQLErrors$3;
135
+ const errorCode = error === null || error === void 0 ? void 0 : (_error$graphQLErrors$ = error.graphQLErrors[0]) === null || _error$graphQLErrors$ === void 0 ? void 0 : (_error$graphQLErrors$2 = _error$graphQLErrors$.extensions) === null || _error$graphQLErrors$2 === void 0 ? void 0 : (_error$graphQLErrors$3 = _error$graphQLErrors$2.errors[0]) === null || _error$graphQLErrors$3 === void 0 ? void 0 : _error$graphQLErrors$3.code;
136
+ return /*#__PURE__*/React.createElement(SafeAreaView, {
137
+ style: styles.container
138
+ }, /*#__PURE__*/React.createElement(ErrorScreen, {
139
+ errorCode: errorCode,
140
+ refresh: () => refetch()
141
+ }));
142
+ }
143
+ if (loading) {
144
+ return /*#__PURE__*/React.createElement(SafeAreaView, _extends({
145
+ style: styles.container
146
+ }, accessibility('routine-container-loading')), /*#__PURE__*/React.createElement(ActivityIndicator, _extends({
147
+ size: "large"
148
+ }, accessibility('routine-activity-indicator'))));
149
+ }
80
150
  return /*#__PURE__*/React.createElement(SafeAreaView, {
81
151
  style: styles.container,
82
152
  testID: "routineStack"
83
- }, /*#__PURE__*/React.createElement(VeraHeader, {
153
+ }, /*#__PURE__*/React.createElement(VeraHeader, _extends({
84
154
  left: /*#__PURE__*/React.createElement(Logo, {
85
155
  accessibilityLabel: "logo"
86
156
  }),
87
157
  right: /*#__PURE__*/React.createElement(HeaderCart, {
88
158
  accessibilityLabel: "crt-btn"
89
159
  }),
90
- title: "Routines",
91
- accessibilityLabel: "header"
92
- }), /*#__PURE__*/React.createElement(View, {
93
- style: {
94
- flex: 1,
95
- backgroundColor: 'white'
96
- }
97
- }, /*#__PURE__*/React.createElement(SectionList, {
98
- stickySectionHeadersEnabled: false,
99
- sections: SECTIONS,
100
- renderSectionHeader: _ref2 => {
101
- let {
102
- section
103
- } = _ref2;
104
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
105
- style: styles.sectionHeader
106
- }, section.title), /*#__PURE__*/React.createElement(FlatList, {
107
- horizontal: true,
108
- data: section.data,
109
- renderItem: _ref3 => {
110
- let {
111
- item,
112
- index
113
- } = _ref3;
114
- return /*#__PURE__*/React.createElement(TouchableOpacity, {
115
- onPress: handleOnPress
116
- }, /*#__PURE__*/React.createElement(ListItem, {
117
- item: item,
118
- index: index
119
- }));
120
- },
121
- showsHorizontalScrollIndicator: false,
122
- contentContainerStyle: {
123
- paddingHorizontal: 15
124
- }
125
- }));
126
- },
127
- renderItem: _ref4 => {
160
+ title: routinesPageData.title
161
+ }, accessibility('routine-activity-indicator'))), /*#__PURE__*/React.createElement(View, {
162
+ style: styles.routinesContainer
163
+ }, routinesPageData && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
164
+ style: styles.sortListText
165
+ }, routinesPageData.sort_list_label), /*#__PURE__*/React.createElement(FlatList, {
166
+ data: routinesPageData.routines,
167
+ renderItem: _ref3 => {
128
168
  let {
129
169
  item,
130
- section,
131
170
  index
132
- } = _ref4;
133
-
134
- if (section.horizontal) {
135
- return null;
136
- }
137
-
171
+ } = _ref3;
138
172
  return /*#__PURE__*/React.createElement(ListItem, {
139
173
  item: item,
140
- index: index
174
+ key: index
141
175
  });
176
+ },
177
+ showsHorizontalScrollIndicator: false,
178
+ contentContainerStyle: {
179
+ paddingHorizontal: 15
142
180
  }
143
- })));
181
+ }))));
144
182
  };
145
-
146
- function RoutineDetails() {
147
- return /*#__PURE__*/React.createElement(View, {
148
- style: {
149
- flex: 1,
150
- alignItems: 'center',
151
- justifyContent: 'center'
152
- }
153
- }, /*#__PURE__*/React.createElement(Text, null, "Routine"));
154
- }
155
-
156
- function RoutineStack(LOG, _ref5) {
183
+ function RoutineStack(_ref4) {
157
184
  let {
158
185
  navigation
159
- } = _ref5;
186
+ } = _ref4;
160
187
  useEffect(() => {
161
188
  const unsubscribe = navigation.addListener('focus', () => {
162
- LOG.info('User navigated to the RoutineStack page.');
189
+ Logger.info('User navigated to the RoutineStack page.');
163
190
  });
164
191
  return unsubscribe;
165
192
  }, [navigation]);
@@ -177,20 +204,25 @@ function RoutineStack(LOG, _ref5) {
177
204
  }
178
205
  }));
179
206
  }
180
-
181
- function useRoutine() {//
182
- }
183
-
184
207
  const styles = StyleSheet.create({
185
208
  container: {
186
209
  flex: 1,
187
- backgroundColor: '#F9F9F9'
210
+ backgroundColor: colors.white
211
+ },
212
+ routinesContainer: {
213
+ backgroundColor: colors.primaryGray,
214
+ flex: 1,
215
+ paddingTop: 10
216
+ },
217
+ listContainer: {
218
+ flexDirection: 'column',
219
+ paddingHorizontal: 15,
220
+ paddingVertical: 10
188
221
  },
189
222
  sectionHeader: {
190
223
  textTransform: 'uppercase',
191
224
  fontWeight: '600',
192
225
  fontSize: 14,
193
- // color: '#f4f4f4',
194
226
  marginTop: 20,
195
227
  paddingHorizontal: 15,
196
228
  marginBottom: 5
@@ -199,19 +231,62 @@ const styles = StyleSheet.create({
199
231
  margin: 10,
200
232
  borderRadius: 14
201
233
  },
234
+ itemContainer: {
235
+ backgroundColor: 'transparent',
236
+ flex: 1,
237
+ marginBottom: 10
238
+ },
239
+ itemTextContainer: {
240
+ backgroundColor: colors.white,
241
+ paddingTop: 20,
242
+ paddingBottom: 10
243
+ },
202
244
  itemPhoto: {
203
- width: 230,
204
- height: 160,
205
- borderRadius: 14
245
+ width: '100%',
246
+ minHeight: 160
247
+ },
248
+ productPhoto: {
249
+ margin: 2,
250
+ width: 40,
251
+ height: 40,
252
+ borderRadius: 50,
253
+ borderColor: '#EDEDED',
254
+ borderStyle: 'solid',
255
+ borderWidth: 1
256
+ },
257
+ itemTitleContainer: {
258
+ flexDirection: 'row',
259
+ justifyContent: 'space-between',
260
+ paddingHorizontal: 15
261
+ },
262
+ itemTextTitle: {
263
+ color: colors.primaryBlack,
264
+ fontWeight: '600',
265
+ fontSize: 18
206
266
  },
207
267
  itemText: {
208
- color: 'rgba(255, 255, 255, 1)',
268
+ color: colors.primaryBlack,
209
269
  fontWeight: 'bold',
210
- marginTop: 5,
211
- position: 'absolute',
212
- left: 16,
213
- bottom: 16
270
+ fontSize: 12,
271
+ letterSpacing: 0.05,
272
+ paddingBottom: 5,
273
+ textTransform: 'uppercase'
274
+ },
275
+ itemTextSteps: {
276
+ color: colors.primaryBlack,
277
+ fontWeight: 'bold',
278
+ textTransform: 'uppercase'
279
+ },
280
+ sortListText: {
281
+ color: colors.primaryBlack,
282
+ fontWeight: 'bold',
283
+ textTransform: 'uppercase',
284
+ textAlign: 'right',
285
+ marginRight: 10,
286
+ letterSpacing: 0.5,
287
+ paddingVertical: 10,
288
+ paddingRight: 20
214
289
  }
215
290
  });
216
- export { RoutineStack, useRoutine };
291
+ export { RoutineStack };
217
292
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useEffect","FlatList","Image","SafeAreaView","SectionList","StyleSheet","Text","TouchableOpacity","View","createNativeStackNavigator","VeraHeader","Logo","HeaderCart","Stack","SECTIONS","title","horizontal","data","key","text","uri","ListItem","item","index","styles","marginLeft","itemPhoto","itemText","Routines","handleOnPress","container","flex","backgroundColor","section","sectionHeader","paddingHorizontal","RoutineDetails","alignItems","justifyContent","RoutineStack","LOG","navigation","unsubscribe","addListener","info","headerShown","useRoutine","create","textTransform","fontWeight","fontSize","marginTop","marginBottom","margin","borderRadius","width","height","color","position","left","bottom"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SACEC,QADF,EAEEC,KAFF,EAGEC,YAHF,EAIEC,WAJF,EAKEC,UALF,EAMEC,IANF,EAOEC,gBAPF,EAQEC,IARF,QASO,cATP;AAUA,SAASC,0BAAT,QAA2C,2BAA3C;AACA,SAASC,UAAT,EAAqBC,IAArB,EAA2BC,UAA3B,QAA6C,eAA7C;AAEA,MAAMC,KAAK,GAAGJ,0BAA0B,EAAxC;AAEA,MAAMK,QAAQ,GAAG,CACf;AACEC,EAAAA,KAAK,EAAE,aADT;AAEEC,EAAAA,UAAU,EAAE,IAFd;AAGEC,EAAAA,IAAI,EAAE,CACJ;AACEC,IAAAA,GAAG,EAAE,GADP;AAEEC,IAAAA,IAAI,EAAE,sBAFR;AAGEC,IAAAA,GAAG,EAAE;AAHP,GADI,EAMJ;AACEF,IAAAA,GAAG,EAAE,GADP;AAEEC,IAAAA,IAAI,EAAE,cAFR;AAGEC,IAAAA,GAAG,EAAE;AAHP,GANI,EAYJ;AACEF,IAAAA,GAAG,EAAE,GADP;AAEEC,IAAAA,IAAI,EAAE,cAFR;AAGEC,IAAAA,GAAG,EAAE;AAHP,GAZI;AAHR,CADe,EAuBf;AACEL,EAAAA,KAAK,EAAE,mBADT;AAEEC,EAAAA,UAAU,EAAE,IAFd;AAGEC,EAAAA,IAAI,EAAE,CACJ;AACEC,IAAAA,GAAG,EAAE,GADP;AAEEC,IAAAA,IAAI,EAAE,cAFR;AAGEC,IAAAA,GAAG,EAAE;AAHP,GADI,EAMJ;AACEF,IAAAA,GAAG,EAAE,GADP;AAEEC,IAAAA,IAAI,EAAE,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U,CAAC0C,MAAX,CAAkB;AAC/BjB,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,CADG;AAETC,IAAAA,eAAe,EAAE;AAFR,GADoB;AAK/BE,EAAAA,aAAa,EAAE;AACbc,IAAAA,aAAa,EAAE,WADF;AAEbC,IAAAA,UAAU,EAAE,KAFC;AAGbC,IAAAA,QAAQ,EAAE,EAHG;AAIb;AACAC,IAAAA,SAAS,EAAE,EALE;AAMbhB,IAAAA,iBAAiB,EAAE,EANN;AAObiB,IAAAA,YAAY,EAAE;AAPD,GALgB;AAc/B9B,EAAAA,IAAI,EAAE;AACJ+B,IAAAA,MAAM,EAAE,EADJ;AAEJC,IAAAA,YAAY,EAAE;AAFV,GAdyB;AAkB/B5B,EAAAA,SAAS,EAAE;AACT6B,IAAAA,KAAK,EAAE,GADE;AAETC,IAAAA,MAAM,EAAE,GAFC;AAGTF,IAAAA,YAAY,EAAE;AAHL,GAlBoB;AAuB/B3B,EAAAA,QAAQ,EAAE;AACR8B,IAAAA,KAAK,EAAE,wBADC;AAERR,IAAAA,UAAU,EAAE,MAFJ;AAGRE,IAAAA,SAAS,EAAE,CAHH;AAIRO,IAAAA,QAAQ,EAAE,UAJF;AAKRC,IAAAA,IAAI,EAAE,EALE;AAMRC,IAAAA,MAAM,EAAE;AANA;AAvBqB,CAAlB,CAAf;AAiCA,SAASrB,YAAT,EAAuBO,UAAvB","sourcesContent":["import React, { useEffect } from 'react';\nimport {\n FlatList,\n Image,\n SafeAreaView,\n SectionList,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport { createNativeStackNavigator } from '@nuskin/mobile-navigation';\nimport { VeraHeader, Logo, HeaderCart } from '@ns/mobile-ui';\n\nconst Stack = createNativeStackNavigator();\n\nconst SECTIONS = [\n {\n title: 'My Routines',\n horizontal: true,\n data: [\n {\n key: '1',\n text: 'Card Title Onessssss',\n uri: 'https://picsum.photos/id/1/200',\n },\n {\n key: '2',\n text: 'Card Title 2',\n uri: 'https://picsum.photos/id/10/200',\n },\n\n {\n key: '3',\n text: 'Card Title 3',\n uri: 'https://picsum.photos/id/1002/200',\n },\n ],\n },\n {\n title: 'Featured Routines',\n horizontal: true,\n data: [\n {\n key: '1',\n text: 'Card Title 1',\n uri: 'https://picsum.photos/id/1011/200',\n },\n {\n key: '2',\n text: 'Card Title 2',\n uri: 'https://picsum.photos/id/1012/200',\n },\n\n {\n key: '3',\n text: 'Card Title 3',\n uri: 'https://picsum.photos/id/1013/200',\n },\n ],\n },\n {\n title: 'Suggested Routines',\n horizontal: true,\n data: [\n {\n key: '1',\n text: 'Card Title 1',\n uri: 'https://picsum.photos/id/1020/200',\n },\n {\n key: '2',\n text: 'Card Title 2',\n uri: 'https://picsum.photos/id/1024/200',\n },\n\n {\n key: '3',\n text: 'Card Title 3',\n uri: 'https://picsum.photos/id/1027/200',\n },\n ],\n },\n];\n\nconst ListItem = ({ item, index }) => {\n return (\n <View style={[styles.item, index === 0 ? { marginLeft: 0 } : {}]}>\n <Image\n source={{\n uri: item.uri,\n }}\n style={styles.itemPhoto}\n resizeMode=\"cover\"\n />\n <Text style={styles.itemText}>{item.text}</Text>\n </View>\n );\n};\n\nconst Routines = () => {\n const handleOnPress = () => {\n // console.log('onPress', section)\n };\n\n return (\n <SafeAreaView style={styles.container} testID=\"routineStack\">\n <VeraHeader\n left={<Logo accessibilityLabel=\"logo\" />}\n right={<HeaderCart accessibilityLabel=\"crt-btn\" />}\n title=\"Routines\"\n accessibilityLabel=\"header\"\n />\n <View style={{ flex: 1, backgroundColor: 'white' }}>\n <SectionList\n stickySectionHeadersEnabled={false}\n sections={SECTIONS}\n renderSectionHeader={({ section }) => (\n <>\n <Text style={styles.sectionHeader}>{section.title}</Text>\n <FlatList\n horizontal\n data={section.data}\n renderItem={({ item, index }) => (\n <TouchableOpacity onPress={handleOnPress}>\n <ListItem item={item} index={index} />\n </TouchableOpacity>\n )}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ paddingHorizontal: 15 }}\n />\n </>\n )}\n renderItem={({ item, section, index }) => {\n if (section.horizontal) {\n return null;\n }\n return <ListItem item={item} index={index} />;\n }}\n />\n </View>\n </SafeAreaView>\n );\n};\n\nfunction RoutineDetails() {\n return (\n <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>\n <Text>Routine</Text>\n </View>\n );\n}\n\nfunction RoutineStack(LOG, { navigation }) {\n useEffect(() => {\n const unsubscribe = navigation.addListener('focus', () => {\n LOG.info('User navigated to the RoutineStack page.');\n });\n return unsubscribe;\n }, [navigation]);\n\n return (\n <Stack.Navigator>\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\nfunction useRoutine() {\n //\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: '#F9F9F9',\n },\n sectionHeader: {\n textTransform: 'uppercase',\n fontWeight: '600',\n fontSize: 14,\n // color: '#f4f4f4',\n marginTop: 20,\n paddingHorizontal: 15,\n marginBottom: 5,\n },\n item: {\n margin: 10,\n borderRadius: 14,\n },\n itemPhoto: {\n width: 230,\n height: 160,\n borderRadius: 14,\n },\n itemText: {\n color: 'rgba(255, 255, 255, 1)',\n fontWeight: 'bold',\n marginTop: 5,\n position: 'absolute',\n left: 16,\n bottom: 16,\n },\n});\n\nexport { RoutineStack, useRoutine };\n"]}
1
+ {"version":3,"names":["React","useEffect","useState","FlatList","Image","SafeAreaView","StyleSheet","Text","TouchableOpacity","View","ActivityIndicator","gql","useQuery","useNavigation","VeraHeader","Logo","HeaderCart","colors","ErrorScreen","localization","localizationState","useSnapshot","RoutineDetails","Logger","accessibility","createStackNavigator","Stack","FETCH_ROUTINES_PAGE","ListItem","item","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","index","product_imageConnection","productPhoto","Routines","localizationStore","refresh","setRefresh","locale","getLocalization","LocalizationFormat","CONTENT_STACK","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","borderStyle","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 colors,\n ErrorScreen,\n} from '@ns/mobile-ui';\nimport { localization, localizationState } 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 routines_description\n routine_step_label\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 }) => {\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 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 style={styles.itemTextTitle}>{item.routine_title}</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 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\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={<HeaderCart accessibilityLabel=\"crt-btn\" />}\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 item={item} key={index} />\n )}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ paddingHorizontal: 15 }}\n />\n </>\n )}\n </View>\n </SafeAreaView>\n );\n};\n\nfunction RoutineStack({ navigation }) {\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>\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 borderStyle: 'solid',\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,MAAM,EACNC,WAAW,QACN,eAAe;AACtB,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,sBAAsB;AACtE,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,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;AAC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AE,OAAO;IAClBC,WAAW,EAAE,EAAE;IACfF,aAAa,EAAE,GAAG;IAClBnB,eAAe,EAAE,EAAE;IACnBsB,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,SAASlC,YAAY"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare function RoutineDetails(props: any): JSX.Element;
3
+ export default RoutineDetails;
@@ -0,0 +1,9 @@
1
+ export declare function accessibility(id?: string): {
2
+ accessible: boolean;
3
+ accessibilityLabel: string | undefined;
4
+ testID?: undefined;
5
+ } | {
6
+ accessible: boolean;
7
+ testID: string | undefined;
8
+ accessibilityLabel?: undefined;
9
+ };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare function RoutineStack(LOG: any, { navigation }: {
2
+ export declare const FETCH_ROUTINES_PAGE: import("@apollo/client").DocumentNode;
3
+ declare function RoutineStack({ navigation }: {
3
4
  navigation: any;
4
5
  }): JSX.Element;
5
- declare function useRoutine(): void;
6
- export { RoutineStack, useRoutine };
6
+ export { RoutineStack };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuskin/routine-feature",
3
3
  "private": false,
4
- "version": "1.0.0",
4
+ "version": "2.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",
@@ -11,7 +11,7 @@
11
11
  "react-native": "src/index.tsx",
12
12
  "source": "src/index.tsx",
13
13
  "module": "lib/module/index.js",
14
- "types": "lib/typescript/src/index.d.ts",
14
+ "types": "lib/typescript/index.d.ts",
15
15
  "files": [
16
16
  "src",
17
17
  "lib",
@@ -30,16 +30,17 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "^17.0.2",
33
- "react-native": ">=0.64.2"
33
+ "react-native": "^0.68.5"
34
34
  },
35
35
  "dependencies": {
36
- "@nuskin/mobile-navigation": "^0.0.1",
37
- "@ns/mobile-ui": "^1.0.0",
38
- "tslib": "^2.3.0"
36
+ "@apollo/client": "^3.7.4",
37
+ "@react-navigation/stack": "^6.2.2",
38
+ "@ns/mobile-ui": "^1.3.41",
39
+ "@nuskin/utils-module": "^1.1.5"
39
40
  },
40
41
  "devDependencies": {
41
- "react-native-builder-bob": "^0.18.1",
42
- "typescript": "4.4.2"
42
+ "react-native-builder-bob": "0.18.3",
43
+ "typescript": "^4.8.3"
43
44
  },
44
45
  "jest": {
45
46
  "preset": "react-native",
@@ -133,10 +134,10 @@
133
134
  ]
134
135
  ]
135
136
  },
136
- "commithash": "8f7f5f9a08ba0f40be7eed2ac51d7eea56295759",
137
+ "commithash": "db5cd5e6cc2d8bfd932e072c4ac1c53cecaab4c7",
137
138
  "author": {
138
- "name": "Treg Anderson",
139
- "email": "tsanderson@nuskin.com",
140
- "url": "https://code.tls.nuskin.io/tsanderson"
139
+ "name": "Camila Urquizo",
140
+ "email": "curquizo@nuskin.com",
141
+ "url": "https://code.tls.nuskin.io/curquizo"
141
142
  }
142
143
  }