ordering-ui-react-native 0.17.22 → 0.17.23

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.17.22",
3
+ "version": "0.17.23",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { LanguageSelector as LanguageSelectorController, useOrder } from 'ordering-components/native'
2
+ import { LanguageSelector as LanguageSelectorController, useOrder, useLanguage } from 'ordering-components/native'
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import { Platform, StyleSheet, View } from 'react-native'
5
5
 
@@ -11,6 +11,7 @@ import { OIcon } from '../shared'
11
11
  const LanguageSelectorUI = (props: LanguageSelectorParams) => {
12
12
 
13
13
  const [orderState] = useOrder()
14
+ const [state] = useLanguage()
14
15
 
15
16
  const theme = useTheme();
16
17
 
@@ -74,7 +75,7 @@ const LanguageSelectorUI = (props: LanguageSelectorParams) => {
74
75
  useNativeAndroidPickerStyle={false}
75
76
  placeholder={{}}
76
77
  Icon={() => <View style={pickerStyle ? pickerStyle.icon : _pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.white} style={{ width: '100%' }} /></View>}
77
- disabled={orderState.loading}
78
+ disabled={orderState.loading || state.loading}
78
79
  />
79
80
  </>
80
81
  ) : <DummyContainer />}
@@ -31,7 +31,8 @@ import {
31
31
  Map,
32
32
  Divider,
33
33
  OrderAction,
34
- PlaceSpotWrapper
34
+ PlaceSpotWrapper,
35
+ ProfessionalPhoto
35
36
  } from './styles';
36
37
  import { OButton, OIcon, OModal, OText } from '../shared';
37
38
  import { ProductItemAccordion } from '../ProductItemAccordion';
@@ -876,6 +877,26 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
876
877
  </OrderAction>
877
878
  </HeaderInfo>
878
879
  <OrderProducts>
880
+ {!!order?.products[0]?.calendar_event?.professional && (
881
+ <View style={{ flexDirection: 'row', alignItems: 'center', width: '100%' }}>
882
+ {!!order?.products[0]?.calendar_event?.professional?.photo ? (
883
+ <ProfessionalPhoto
884
+ source={{
885
+ uri: order?.products[0]?.calendar_event?.professional?.photo
886
+ }}
887
+ imageStyle={{ borderRadius: 8 }}
888
+ />
889
+ ) : (
890
+ <OIcon
891
+ src={theme.images.general.user}
892
+ cover={false}
893
+ width={82}
894
+ height={82}
895
+ />
896
+ )}
897
+ <OText size={12} lineHeight={18} weight={'500'} numberOfLines={1}>{order?.products[0]?.calendar_event?.professional?.name} {order?.products[0]?.calendar_event?.professional?.lastname}</OText>
898
+ </View>
899
+ )}
879
900
  {order?.products?.length &&
880
901
  order?.products.map((product: any, i: number) => (
881
902
  <ProductItemAccordion
@@ -132,3 +132,13 @@ export const OrderAction = styled.View`
132
132
  export const PlaceSpotWrapper = styled.View`
133
133
  padding-horizontal: 40px;
134
134
  `
135
+
136
+ export const ProfessionalPhoto = styled.ImageBackground`
137
+ width: 100%;
138
+ position: relative;
139
+ max-height: 82px;
140
+ height: 82px;
141
+ width: 82px;
142
+ resize-mode: cover;
143
+ margin-right: 10px;
144
+ `;