import React, { Component, PropTypes } from 'react'; import { If, Then } from 'react-if'; import { Layout, Container, Header } from './Layout'; import { servers } from '../constants'; import CustomScrollbars from './CustomScrollbars'; export default class SelectLocation extends Component { static propTypes = { onChangeLocation: PropTypes.func.isRequired } onClose() { this.props.router.push('/connect'); } handleSelection(name) { this.props.onChangeLocation(name); this.props.router.push('/connect'); } handleFastest() { this.props.onChangeLocation('fastest'); this.props.router.push('/connect'); } handleNearest() { this.props.onChangeLocation('nearest'); this.props.router.push('/connect'); } isSelected(key) { return key === this.props.settings.preferredServer; } drawCell(key, name, icon, onClick) { const classes = ['select-location__cell']; const selected = this.isSelected(key); if(selected) { classes.push('select-location__cell--selected'); } const cellClass = classes.join(' '); return (