-
Notifications
You must be signed in to change notification settings - Fork 6
/
listHouseholdsComponent.jsx
40 lines (38 loc) · 1.27 KB
/
listHouseholdsComponent.jsx
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
import React from "react";
import { Component } from "react";
import HouseholdRoutingController from "../Controllers/householdRoutingController";
import HeaderComponent from "./headerComponent";
/**
* Class component that is given an array of households through props and displays a button for each household
*/
class ListHouseholdsComponent extends Component {
/**
* @param props.households {Array} Array of JSON objects each containing information for a household
* @param props.museClientConfig {JSON} Contains access token for Sonos API call
*/
constructor(props) {
super(props);
}
render() {
return (
<div>
<div className="main_page">
<HeaderComponent />
<div className="group_text">
<p>Households</p>
</div>
{/* For each household in this.props.households, a button is created that when clicked, routes the user to that household */}
{this.props.households.map((household, index) => (
<HouseholdRoutingController
key={household.id}
household={household}
index={index}
museClientConfig={this.props.museClientConfig}
/>
))}
</div>
</div>
);
}
}
export default ListHouseholdsComponent;