ordering-ui-react-native 0.16.37 → 0.16.38

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": "ordering-ui-react-native",
3
- "version": "0.16.37",
3
+ "version": "0.16.38",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -332,6 +332,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
332
332
  export const ReviewOrder = (props: ReviewOrderParams) => {
333
333
  const reviewOrderProps = {
334
334
  ...props,
335
+ defaultStar: 0,
335
336
  UIComponent: ReviewOrderUI
336
337
  }
337
338
  return <ReviewOrderController {...reviewOrderProps} />
@@ -1,10 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, View, TouchableOpacity } from 'react-native';
2
+ import { StyleSheet, View, TouchableOpacity, Linking } from 'react-native';
3
3
  import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { OIcon, OText, OModal } from '../shared';
6
6
  import { BusinessBasicInformationParams } from '../../types';
7
7
  import { convertHoursToMinutes, shape } from '../../utils';
8
+ import MaterialComIcon from 'react-native-vector-icons/MaterialCommunityIcons'
8
9
  import dayjs from 'dayjs';
9
10
  import timezone from 'dayjs/plugin/timezone';
10
11
  import isBetween from 'dayjs/plugin/isBetween';
@@ -21,7 +22,8 @@ import {
21
22
  WrapReviews,
22
23
  WrapBusinessInfo,
23
24
  TitleWrapper,
24
- RibbonBox
25
+ RibbonBox,
26
+ SocialListWrapper
25
27
  } from './styles';
26
28
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
27
29
  const types = ['food', 'laundry', 'alcohol', 'groceries'];
@@ -44,6 +46,64 @@ export const BusinessBasicInformation = (
44
46
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
45
47
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
46
48
 
49
+ const styles = StyleSheet.create({
50
+ businesInfoheaderStyle: {
51
+ height: 150,
52
+ },
53
+ headerStyle: {
54
+ height: 260,
55
+ },
56
+ businessLogo: {
57
+ width: 72,
58
+ height: 72,
59
+ borderRadius: 7.6,
60
+ justifyContent: 'flex-start',
61
+ alignItems: 'flex-start',
62
+ },
63
+ businessInfo: {
64
+ paddingHorizontal: 40,
65
+ paddingTop: 56,
66
+ },
67
+ bullet: {
68
+ flexDirection: 'row',
69
+ alignItems: 'center',
70
+ },
71
+ metadata: {
72
+ marginRight: 2,
73
+ },
74
+ starIcon: {
75
+ marginHorizontal: 5,
76
+ },
77
+ reviewStyle: {
78
+ flexDirection: 'row',
79
+ alignItems: 'center',
80
+ justifyContent: 'center'
81
+ },
82
+ modalTitleSectionStyle: {
83
+ position: 'absolute',
84
+ width: '100%',
85
+ top: 0,
86
+ zIndex: 100,
87
+ left: 40
88
+ },
89
+ socialIcon: {
90
+ borderRadius: 3,
91
+ borderColor: theme.colors.border,
92
+ borderWidth: 1,
93
+ width: 20,
94
+ height: 20,
95
+ justifyContent: 'center',
96
+ alignItems: 'center',
97
+ marginLeft: 5
98
+ },
99
+ tiktokIcon: {
100
+ height: 12,
101
+ width: 12,
102
+ margin: 0,
103
+ padding: 0
104
+ }
105
+ });
106
+
47
107
  const handleClickBusinessInformation = () => {
48
108
  if (!businessInformationObtained) {
49
109
  BusinessInformation = require('../BusinessInformation').BusinessInformation
@@ -73,6 +133,19 @@ export const BusinessBasicInformation = (
73
133
  return _types.join(', ');
74
134
  };
75
135
 
136
+ const SocialNetWork = (props: any) => {
137
+ const { socialLink, iconTitle} = props
138
+
139
+ return (
140
+ <TouchableOpacity style={styles.socialIcon} onPress={() => Linking.openURL(socialLink)}>
141
+ <MaterialComIcon
142
+ name={iconTitle}
143
+ color={theme.colors.textNormal}
144
+ size={14}
145
+ />
146
+ </TouchableOpacity>
147
+ )
148
+ }
76
149
 
77
150
  useEffect(() => {
78
151
  if (businessState?.loading) return
@@ -165,6 +238,53 @@ export const BusinessBasicInformation = (
165
238
  </OText>
166
239
  </RibbonBox>
167
240
  )}
241
+ <SocialListWrapper
242
+ showsVerticalScrollIndicator={false}
243
+ showsHorizontalScrollIndicator={false}
244
+ horizontal
245
+ contentContainerStyle={{ flex: 1, justifyContent: 'flex-end'}}
246
+ >
247
+ {!!business?.facebook_profile && (
248
+ <SocialNetWork
249
+ socialLink={business?.facebook_profile}
250
+ iconTitle='facebook'
251
+ />
252
+ )}
253
+ {!!business?.instagram_profile && (
254
+ <SocialNetWork
255
+ socialLink={business?.instagram_profile}
256
+ iconTitle='instagram'
257
+ />
258
+ )}
259
+ {!!business?.tiktok_profile && (
260
+ <TouchableOpacity style={styles.socialIcon} onPress={() => Linking.openURL(business?.tiktok_profile)}>
261
+ <View style={styles.tiktokIcon}>
262
+ <OIcon
263
+ src={theme.images.general.tiktok}
264
+ style={{ width: '100%', height: '100%'}}
265
+ />
266
+ </View>
267
+ </TouchableOpacity>
268
+ )}
269
+ {!!business?.pinterest_profile && (
270
+ <SocialNetWork
271
+ socialLink={business?.pinterest_profile}
272
+ iconTitle='pinterest'
273
+ />
274
+ )}
275
+ {!!business?.whatsapp_number && (
276
+ <SocialNetWork
277
+ socialLink={business?.whatsapp_number}
278
+ iconTitle='whatsapp'
279
+ />
280
+ )}
281
+ {!!business?.snapchat_profile && (
282
+ <SocialNetWork
283
+ socialLink={business?.snapchat_profile}
284
+ iconTitle='snapchat'
285
+ />
286
+ )}
287
+ </SocialListWrapper>
168
288
  </TitleWrapper>
169
289
  )}
170
290
  </BusinessInfoItem>
@@ -276,45 +396,3 @@ export const BusinessBasicInformation = (
276
396
  </BusinessContainer>
277
397
  );
278
398
  };
279
-
280
- const styles = StyleSheet.create({
281
- businesInfoheaderStyle: {
282
- height: 150,
283
- },
284
- headerStyle: {
285
- height: 260,
286
- },
287
- businessLogo: {
288
- width: 72,
289
- height: 72,
290
- borderRadius: 7.6,
291
- justifyContent: 'flex-start',
292
- alignItems: 'flex-start',
293
- },
294
- businessInfo: {
295
- paddingHorizontal: 40,
296
- paddingTop: 56,
297
- },
298
- bullet: {
299
- flexDirection: 'row',
300
- alignItems: 'center',
301
- },
302
- metadata: {
303
- marginRight: 2,
304
- },
305
- starIcon: {
306
- marginHorizontal: 5,
307
- },
308
- reviewStyle: {
309
- flexDirection: 'row',
310
- alignItems: 'center',
311
- justifyContent: 'center'
312
- },
313
- modalTitleSectionStyle: {
314
- position: 'absolute',
315
- width: '100%',
316
- top: 0,
317
- zIndex: 100,
318
- left: 40
319
- },
320
- });
@@ -68,3 +68,7 @@ export const RibbonBox = styled.View`
68
68
  border-radius: 50px;
69
69
  `}
70
70
  `
71
+
72
+ export const SocialListWrapper = styled.ScrollView`
73
+ flex-direction: row;
74
+ `