-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdummy-data.tsx
332 lines (325 loc) · 6.95 KB
/
dummy-data.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// Dummy Datas
import { icons, images } from "./constants";
import { CategoryData, CurrentLocation, Restaurant } from "./types";
export const initialCurrentLocation: CurrentLocation = {
streetName: 'Kuching',
gps: {
latitude: 1.5496614931250685,
longitude: 110.36381866919922,
},
};
export const categoryData: CategoryData[] = [
{
id: 1,
name: 'Rice',
icon: icons.rice_bowl,
},
{
id: 2,
name: 'Noodles',
icon: icons.noodle,
},
{
id: 3,
name: 'Hot Dogs',
icon: icons.hotdog,
},
{
id: 4,
name: 'Salads',
icon: icons.salad,
},
{
id: 5,
name: 'Burgers',
icon: icons.hamburger,
},
{
id: 6,
name: 'Pizza',
icon: icons.pizza,
},
{
id: 7,
name: 'Snacks',
icon: icons.fries,
},
{
id: 8,
name: 'Sushi',
icon: icons.sushi,
},
{
id: 9,
name: 'Desserts',
icon: icons.donut,
},
{
id: 10,
name: 'Drinks',
icon: icons.drink,
},
];
// price rating
export const affordable = 1;
export const fairPrice = 2;
export const expensive = 3;
export const restaurantData: Restaurant[] = [
{
id: 1,
name: 'Burger',
rating: 4.8,
categories: [5, 7],
priceRating: affordable,
photo: images.burger_restaurant_1,
duration: '30 - 45 min',
location: {
latitude: 1.5347282806345879,
longitude: 110.35632207358996,
},
courier: {
avatar: images.avatar_1,
name: 'Amy',
},
menu: [
{
menuId: 1,
name: 'Crispy Chicken Burger',
photo: images.crispy_chicken_burger,
description: 'Burger with crispy chicken, cheese and lettuce',
calories: 200,
price: 10,
},
{
menuId: 2,
name: 'Crispy Chicken Burger with Honey Mustard',
photo: images.honey_mustard_chicken_burger,
description: 'Crispy Chicken Burger with Honey Mustard Coleslaw',
calories: 250,
price: 15,
},
{
menuId: 3,
name: 'Crispy Baked French Fries',
photo: images.baked_fries,
description: 'Crispy Baked French Fries',
calories: 194,
price: 8,
},
],
},
{
id: 2,
name: 'Pizza',
rating: 4.8,
categories: [2, 4, 6],
priceRating: expensive,
photo: images.pizza_restaurant,
duration: '15 - 20 min',
location: {
latitude: 1.556306570595712,
longitude: 110.35504616746915,
},
courier: {
avatar: images.avatar_2,
name: 'Jackson',
},
menu: [
{
menuId: 4,
name: 'Hawaiian Pizza',
photo: images.hawaiian_pizza,
description: 'Canadian bacon, homemade pizza crust, pizza sauce',
calories: 250,
price: 15,
},
{
menuId: 5,
name: 'Tomato & Basil Pizza',
photo: images.pizza,
description:
'Fresh tomatoes, aromatic basil pesto and melted bocconcini',
calories: 250,
price: 20,
},
{
menuId: 6,
name: 'Tomato Pasta',
photo: images.tomato_pasta,
description: 'Pasta with fresh tomatoes',
calories: 100,
price: 10,
},
{
menuId: 7,
name: 'Mediterranean Chopped Salad ',
photo: images.salad,
description: 'Finely chopped lettuce, tomatoes, cucumbers',
calories: 100,
price: 10,
},
],
},
{
id: 3,
name: 'Hotdogs',
rating: 4.8,
categories: [3],
priceRating: expensive,
photo: images.hot_dog_restaurant,
duration: '20 - 25 min',
location: {
latitude: 1.5238753474714375,
longitude: 110.34261833833622,
},
courier: {
avatar: images.avatar_3,
name: 'James',
},
menu: [
{
menuId: 8,
name: 'Chicago Style Hot Dog',
photo: images.chicago_hot_dog,
description: 'Fresh tomatoes, all beef hot dogs',
calories: 100,
price: 20,
},
],
},
{
id: 4,
name: 'Sushi',
rating: 4.8,
categories: [8],
priceRating: expensive,
photo: images.japanese_restaurant,
duration: '10 - 15 min',
location: {
latitude: 1.5578068150528928,
longitude: 110.35482523764315,
},
courier: {
avatar: images.avatar_4,
name: 'Ahmad',
},
menu: [
{
menuId: 9,
name: 'Sushi sets',
photo: images.sushi,
description: 'Fresh salmon, sushi rice, fresh juicy avocado',
calories: 100,
price: 50,
},
],
},
{
id: 5,
name: 'Cuisine',
rating: 4.8,
categories: [1, 2],
priceRating: affordable,
photo: images.noodle_shop,
duration: '15 - 20 min',
location: {
latitude: 1.558050496260768,
longitude: 110.34743759630511,
},
courier: {
avatar: images.avatar_4,
name: 'Muthu',
},
menu: [
{
menuId: 10,
name: 'Kolo Mee',
photo: images.kolo_mee,
description: 'Noodles with char siu',
calories: 200,
price: 5,
},
{
menuId: 11,
name: 'Sarawak Laksa',
photo: images.sarawak_laksa,
description: 'Vermicelli noodles, cooked prawns',
calories: 300,
price: 8,
},
{
menuId: 12,
name: 'Nasi Lemak',
photo: images.nasi_lemak,
description: 'A traditional Malay rice dish',
calories: 300,
price: 8,
},
{
menuId: 13,
name: 'Nasi Briyani with Mutton',
photo: images.nasi_briyani_mutton,
description: 'A traditional Indian rice dish with mutton',
calories: 300,
price: 8,
},
],
},
{
id: 6,
name: 'Dessets',
rating: 4.9,
categories: [9, 10],
priceRating: affordable,
photo: images.kek_lapis_shop,
duration: '35 - 40 min',
location: {
latitude: 1.5573478487252896,
longitude: 110.35568783282145,
},
courier: {
avatar: images.avatar_1,
name: 'Jessie',
},
menu: [
{
menuId: 12,
name: 'Teh C Peng',
photo: images.teh_c_peng,
description: 'Three Layer Teh C Peng',
calories: 100,
price: 2,
},
{
menuId: 13,
name: 'ABC Ice Kacang',
photo: images.ice_kacang,
description: 'Shaved Ice with red beans',
calories: 100,
price: 3,
},
{
menuId: 14,
name: 'Kek Lapis',
photo: images.kek_lapis,
description: 'Layer cakes',
calories: 300,
price: 20,
},
],
},
];
export const categoriesMap: {[key: number]: string} = categoryData.reduce(
(categoryMap, category: CategoryData) =>
(categoryMap = {
...categoryMap,
[category.id]: category.name,
}),
{},
);
export const restaurantsWithCategories: Restaurant[] = restaurantData.map((restaurant) => ({
...restaurant,
categoryNames: restaurant.categories.map(
(category: number) => categoriesMap[category],
),
}));