-
Notifications
You must be signed in to change notification settings - Fork 11
/
App.js
80 lines (74 loc) · 1.81 KB
/
App.js
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
import React, {Component} from 'react';
import { StyleSheet, View} from 'react-native';
import Accordian from './app/Accordian'
import { Colors } from './app/Colors';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
menu :[
{
title: 'Non Veg Biryanis',
data: [
{key:'Chicken Biryani', value:false},
{key:'Mutton Biryani', value:false},
{key:'Prawns Biryani', value:false},
]
},
{
title: 'Pizzas',
data: [
{key:'Chicken Dominator', value:false},
{key:'Peri Peri Chicken', value:false},
{key:'Indie Tandoori Paneer', value:false},
{key:'Veg Extraveganza', value:false}
]
},
{
title: 'Drinks',
data: [
{key:'Cocktail', value:false},
{key:'Mocktail', value:false},
{key:'Lemon Soda', value:false},
{key:'Orange Soda', value:false}
]
},
{
title: 'Deserts',
data: [
{key:'Choco Lava Cake', value:false},
{key:'Gulabjamun', value:false},
{key:'Kalajamun', value:false},
{key:'Jalebi', value:false}
]
},
]
}
}
render() {
return (
<View style={styles.container}>
{ this.renderAccordians() }
</View>
);
}
renderAccordians=()=> {
const items = [];
for (item of this.state.menu) {
items.push(
<Accordian
title = {item.title}
data = {item.data}
/>
);
}
return items;
}
}
const styles = StyleSheet.create({
container: {
flex:1,
paddingTop:100,
backgroundColor:Colors.PRIMARY,
}
});