ordering-ui-react-native 0.12.49 → 0.12.50

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.12.49",
3
+ "version": "0.12.50",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -10,6 +10,7 @@ import {
10
10
  OrderInformation,
11
11
  BusinessInformation,
12
12
  Price,
13
+ LoadMore
13
14
  } from './styles';
14
15
  import { View, StyleSheet } from 'react-native';
15
16
  import { getGoogleMapImage } from '../../utils';
@@ -113,6 +114,18 @@ export const ActiveOrders = (props: ActiveOrdersParams) => {
113
114
  orders.map((order: any, index: any) => (
114
115
  <Order key={order?.id || order?.uuid} order={order} index={index} />
115
116
  ))}
117
+ {pagination?.totalPages && pagination?.currentPage < pagination?.totalPages && (
118
+ <LoadMore>
119
+ <OButton
120
+ bgColor={theme.colors.white}
121
+ textStyle={{ color: theme.colors.primary, fontSize: 14 }}
122
+ text={t('LOAD_MORE_ORDERS', 'Load more orders')}
123
+ borderColor={theme.colors.primary}
124
+ onClick={loadMoreOrders}
125
+ style={styles.loadMoreButton}
126
+ />
127
+ </LoadMore>
128
+ )}
116
129
  </ActiveOrdersContainer>
117
130
  <View
118
131
  style={{
@@ -140,4 +153,10 @@ const styles = StyleSheet.create({
140
153
  alignItems: 'center',
141
154
  minWidth: 230,
142
155
  },
156
+ loadMoreButton: {
157
+ width: 200,
158
+ height: 46,
159
+ marginLeft: 'auto',
160
+ marginRight: 'auto',
161
+ },
143
162
  });
@@ -42,3 +42,8 @@ export const Price = styled.View`
42
42
  margin-left: 10px;
43
43
  width: 30%;
44
44
  `
45
+ export const LoadMore = styled.View`
46
+ flex-direction: row;
47
+ justify-content: center;
48
+ margin-top: 10px;
49
+ `
@@ -3,9 +3,9 @@ import styled, { css } from 'styled-components/native';
3
3
  export const Card = styled.TouchableOpacity`
4
4
  margin-vertical: 20px;
5
5
  border-radius: 7.6px;
6
- flex: 1;
7
6
  width: 100%;
8
- `;
7
+ position: relative;
8
+ `
9
9
 
10
10
  export const BusinessHero = styled.View`
11
11
  position: relative;
@@ -40,9 +40,9 @@ export const Metadata = styled.View`
40
40
  `;
41
41
 
42
42
  export const BusinessState = styled.View`
43
- position: absolute;
44
- top: 13px;
45
- end: 18px;
43
+ position: absolute;
44
+ top: 13px;
45
+ end: 18px;
46
46
  `
47
47
 
48
48
  export const BusinessLogo = styled.View`
@@ -29,7 +29,7 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
29
29
  const [, t] = useLanguage();
30
30
 
31
31
  const theme = useTheme();
32
- const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
32
+ const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
33
33
 
34
34
  const renderTypes = ({ item }: any) => {
35
35
  return (
@@ -110,17 +110,17 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
110
110
  entireModal
111
111
  >
112
112
  <ScrollView style={styles.allCategoriesContainer}>
113
- <OText
114
- size={20}
115
- mBottom={30}
116
- color={theme.colors.textSecondary}
117
- style={{ paddingHorizontal: 10 }}
118
- >
119
- {t('ALL_CATEGORIES', 'All categories')}
120
- </OText>
121
- <View style={styles.allCategoriesWrapper}>
122
- {typesState?.types.map((item: any) => (
123
- <TouchableOpacity
113
+ <OText
114
+ size={20}
115
+ mBottom={30}
116
+ color={theme.colors.textSecondary}
117
+ style={{ paddingHorizontal: 10 }}
118
+ >
119
+ {t('ALL_CATEGORIES', 'All categories')}
120
+ </OText>
121
+ <View style={styles.allCategoriesWrapper}>
122
+ {typesState?.types.map((item: any) => (
123
+ <TouchableOpacity
124
124
  key={item.id}
125
125
  style={styles.categoryStyle}
126
126
  onPress={() => {
@@ -149,9 +149,9 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
149
149
  {t(`BUSINESS_TYPE_${item.name.replace(/\s/g, '_').toUpperCase()}`, item.name)}
150
150
  </OText>
151
151
  </TouchableOpacity>
152
- ))}
153
- </View>
154
- </ScrollView>
152
+ ))}
153
+ </View>
154
+ </ScrollView>
155
155
  </OModal>
156
156
  </>
157
157
  );
@@ -178,7 +178,7 @@ const styles = StyleSheet.create({
178
178
  marginHorizontal: 10,
179
179
  marginBottom: 40
180
180
  },
181
- allCategoriesContainer : {
181
+ allCategoriesContainer: {
182
182
  paddingHorizontal: 30,
183
183
  paddingVertical: 30
184
184
  },
@@ -5,6 +5,7 @@ export const BCContainer = styled.View`
5
5
  width: 100%;
6
6
  justify-content: flex-start;
7
7
  text-align: center;
8
+ min-height: 45px;
8
9
  `
9
10
 
10
11
  export const BusinessCategories = styled.View`
@@ -281,15 +281,14 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
281
281
  />
282
282
  )}
283
283
  {businessesList.businesses?.map(
284
- (business: any) =>
285
- !business.featured && (
286
- <BusinessController
287
- key={business.id}
288
- business={business}
289
- handleCustomClick={handleBusinessClick}
290
- orderType={orderState?.options?.type}
291
- />
292
- ),
284
+ (business: any) => (
285
+ <BusinessController
286
+ key={business.id}
287
+ business={business}
288
+ handleCustomClick={handleBusinessClick}
289
+ orderType={orderState?.options?.type}
290
+ />
291
+ )
293
292
  )}
294
293
  {businessesList.loading && (
295
294
  <>
@@ -71,5 +71,6 @@ export const FeaturedWrapper = styled.View`
71
71
 
72
72
  export const OrderProgressWrapper = styled.View`
73
73
  margin-top: 37px;
74
+ margin-bottom: 20px;
74
75
  padding-horizontal: 40px;
75
76
  `