import React from 'react'; import Modal from 'react-modal'; import Icon from '/imports/ui/components/icon/component'; import Button from '/imports/ui/components/button/component'; import BaseModal from '../BaseModal'; import AudioMenu from './submenus/AudioMenu'; import VideoMenu from './submenus/VideoMenu'; import ApplicationMenu from './submenus/ApplicationMenu'; import UsersMenu from './submenus/UsersMenu'; import SessionMenu from './submenus/SessionMenu'; import classNames from 'classnames'; import ReactDOM from 'react-dom'; import styles from './styles'; export default class SettingsModal extends BaseModal { constructor(props) { super(props); this.submenus = []; } componentWillMount() { this.setState({ activeSubmenu: 0 }); this.submenus.push({ className: AudioMenu, props: { title: 'Audio', prependIconName: 'ion-', icon: 'ios-mic-outline', }, }); this.submenus.push({ className: VideoMenu, props: { title: 'Video', prependIconName: 'ion-', icon: 'ios-videocam-outline', }, }); this.submenus.push({ className: ApplicationMenu, props: { title: 'App', prependIconName: 'ion-', icon: 'ios-folder-outline', }, }); this.submenus.push({ className: UsersMenu, props: { title: 'Participants', prependIconName: 'ion-', icon: 'person', }, }); this.submenus.push({ className: SessionMenu, props: { title: 'Session', prependIconName: 'ion-', icon: 'android-exit', }, }); } componentDidMount() { ReactDOM.render( , document.getElementById('settingsButtonPlaceHolder')); } createMenu() { const curr = this.state.activeSubmenu === undefined ? 0 : this.state.activeSubmenu; let props = { title: this.submenus[curr].props.title, prependIconName: this.submenus[curr].props.prependIconName, icon: this.submenus[curr].props.icon, }; const Submenu = this.submenus[curr].className; return ; } clickSubmenu(i) { this.setState({ activeSubmenu: i }); } getContent() { return (
    {this.submenus.map((value, index) => (
  • {value.props.title}
  • ))}
{this.createMenu()}
); } }; SettingsModal.defaultProps = { title: 'Settings' };