/**
 * React Starter Kit (https://www.reactstarterkit.com/)
 *
 * Copyright © 2014-present Kriasoft, LLC. All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */

import React from 'react';
import PropTypes from 'prop-types';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import { Row, Col } from 'react-bootstrap';
import s from './CourseUsers.css';

class CourseUsers extends React.Component {
  static propTypes = {
    course: PropTypes.shape({
      id: PropTypes.string.isRequired,
      title: PropTypes.string.isRequired,
      users: PropTypes.arrayOf(
        PropTypes.shape({
          id: PropTypes.string,
        }),
      ),
    }).isRequired,
  };

  static contextTypes = {
    store: PropTypes.any.isRequired,
    fetch: PropTypes.func.isRequired,
  };

  render() {
    const { users } = this.props.course;
    return (
      <div className={s.root}>
        <div className={s.container}>
          <Row>
            <h2>Subscribed to {this.props.course.title}:</h2>
            <Col xs={12} md={10}>
              <ol>
                {users.map(user => (
                  <li key={user.id}>
                    <a href={`/users/${user.id}`}>{user.email}</a> (
                    {user.role})
                  </li>
                ))}
              </ol>
            </Col>
          </Row>
        </div>
      </div>
    );
  }
}

export default withStyles(s)(CourseUsers);

@@ -398,13 +398,8 @@
 rt %7B
- Row,
  Col
@@ -1033,28 +1033,10 @@
    %3C
-Row%3E%0A            %3Ch2
+h1
 %3ESub
@@ -1075,13 +1075,12 @@
 tle%7D
-:
 %3C/h
-2
+1
 %3E%0A  
@@ -1087,18 +1087,16 @@
         
-  
 %3CCol xs=
@@ -1109,18 +1109,16 @@
 d=%7B10%7D%3E%0A
-  
         
@@ -1136,26 +1136,24 @@
             
-  
 %7Busers.map(u
@@ -1177,18 +1177,16 @@
         
- 
- 
 %3Cli key=
@@ -1196,18 +1196,16 @@
 er.id%7D%3E%0A
-  
         
@@ -1277,26 +1277,24 @@
             
-  
 %7Buser.role%7D)
@@ -1310,18 +1310,16 @@
         
-  
 %3C/li%3E%0A  
@@ -1334,16 +1334,12 @@
     
- 
- 
 ))%7D%0A
-  
     
@@ -1366,34 +1366,15 @@
     
-  
 %3C/Col%3E%0A
-          %3C/Row%3E%0A
     

fix headers (close #38) (#58)