2016-05-06 05:14:39 +08:00
|
|
|
import React from 'react';
|
|
|
|
import Modal from 'react-modal';
|
2016-05-20 21:37:19 +08:00
|
|
|
import Icon from '/imports/ui/components/icon/component';
|
|
|
|
import Button from '/imports/ui/components/button/component';
|
2016-08-25 07:00:38 +08:00
|
|
|
import BaseMenu from '../base/component';
|
2016-05-06 05:14:39 +08:00
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import FontControl from '/imports/api/FontControl';
|
2016-09-01 21:56:41 +08:00
|
|
|
import styles from '../styles.scss';
|
2016-05-06 05:14:39 +08:00
|
|
|
|
2016-12-14 11:40:32 +08:00
|
|
|
import { getFontSizeName, increaseFontSize, decreaseFontSize } from '/imports/api/FontControl';
|
|
|
|
|
2016-05-06 05:14:39 +08:00
|
|
|
export default class ApplicationMenu extends BaseMenu {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
2016-12-14 11:40:32 +08:00
|
|
|
//this.state = {
|
|
|
|
// currentFontSize: FontControl.fontSizeEnum.MEDIUM,
|
|
|
|
//};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentWillMount () {
|
|
|
|
console.log('####### Application Component Will Mount ########');
|
|
|
|
if ( localStorage.bbbSavedFontSize ) {
|
|
|
|
this.setState({currentFontSize: localStorage.bbbSavedFontSize});
|
|
|
|
}else if ( localStorage.bbbFontSize ){
|
|
|
|
this.setState({currentFontSize: localStorage.bbbFontSize});
|
|
|
|
}else{
|
|
|
|
this.setState({currentFontSize: 3});
|
2016-05-06 05:14:39 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-12-14 11:40:32 +08:00
|
|
|
componentWillUnmount() {
|
|
|
|
console.log('####### Application Component Unmounting ########');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
console.log('######### local Storage values ##########');
|
|
|
|
console.log(localStorage);
|
2016-05-06 05:14:39 +08:00
|
|
|
return (
|
2016-08-24 02:04:49 +08:00
|
|
|
<div className={styles.full} role='presentation'>
|
|
|
|
<div className={styles.row} role='presentation'>
|
2016-08-26 03:23:09 +08:00
|
|
|
<label><input type='checkbox' tabIndex='7' aria-labelledby='audioNotifLabel'
|
2016-08-06 03:21:35 +08:00
|
|
|
aria-describedby='audioNotifDesc' />Audio notifications for chat</label>
|
2016-08-24 02:04:49 +08:00
|
|
|
<div id='audioNotifLabel' hidden>Audio notifications</div>
|
|
|
|
<div id='audioNotifDesc' hidden>
|
2016-08-06 03:21:35 +08:00
|
|
|
Toggles the audio notifications for chat.</div>
|
2016-05-06 05:14:39 +08:00
|
|
|
</div>
|
2016-08-24 02:04:49 +08:00
|
|
|
<div className={styles.row} role='presentation'>
|
2016-08-26 03:23:09 +08:00
|
|
|
<label><input type='checkbox' tabIndex='8' aria-labelledby='pushNotifLabel'
|
2016-08-06 03:21:35 +08:00
|
|
|
aria-describedby='pushNotifDesc' />Push notifications for chat</label>
|
2016-08-24 02:04:49 +08:00
|
|
|
<div id='pushNotifLabel' hidden>Push notifications</div>
|
|
|
|
<div id='pushNotifDesc' hidden>
|
2016-08-06 03:21:35 +08:00
|
|
|
Toggles the push notifications for chat.</div>
|
2016-06-07 03:52:03 +08:00
|
|
|
</div>
|
2016-07-12 01:01:09 +08:00
|
|
|
<div className={styles.applicationFontContainer} role='presentation'>
|
2016-06-07 03:52:03 +08:00
|
|
|
<div className={styles.fontBarLeft}>
|
|
|
|
<p>Font size</p>
|
|
|
|
</div>
|
|
|
|
<div className={styles.fontBarMid}>
|
2016-12-14 11:40:32 +08:00
|
|
|
<p>{getFontSizeName.call(this, this.state.currentFontSize)/*getFontSizeName.call(this)*/}</p>
|
2016-06-07 03:52:03 +08:00
|
|
|
</div>
|
2016-07-12 01:01:09 +08:00
|
|
|
<div className={styles.fontBarRight} role='presentation'>
|
2016-06-07 03:52:03 +08:00
|
|
|
<Button
|
2016-12-14 11:40:32 +08:00
|
|
|
onClick={increaseFontSize.bind(this)}
|
2016-07-12 01:01:09 +08:00
|
|
|
icon={'circle-add'}
|
|
|
|
circle={true}
|
2016-08-26 03:23:09 +08:00
|
|
|
tabIndex={9}
|
2016-07-12 01:01:09 +08:00
|
|
|
hideLabel={true}
|
|
|
|
label={'Increase Font'}
|
|
|
|
aria-labelledby={'sizeUpLabel'}
|
|
|
|
aria-describedby={'sizeUpDesc'}
|
2016-06-07 03:52:03 +08:00
|
|
|
/>
|
2016-08-24 02:04:49 +08:00
|
|
|
<div id='sizeUpLabel' hidden>Font size up</div>
|
|
|
|
<div id='sizeUpDesc' hidden>
|
2016-08-06 03:21:35 +08:00
|
|
|
Increases the font size of the application.</div>
|
2016-06-07 03:52:03 +08:00
|
|
|
<Button
|
2016-12-14 11:40:32 +08:00
|
|
|
onClick={decreaseFontSize.bind(this)}
|
2016-07-12 01:01:09 +08:00
|
|
|
icon={'circle-minus'}
|
|
|
|
circle={true}
|
2016-08-26 03:23:09 +08:00
|
|
|
tabIndex={10}
|
2016-07-12 01:01:09 +08:00
|
|
|
hideLabel={true}
|
|
|
|
label={'Decrease Font'}
|
|
|
|
aria-labelledby={'sizeDownLabel'}
|
|
|
|
aria-describedby={'sizeDownDesc'}
|
2016-06-07 03:52:03 +08:00
|
|
|
/>
|
2016-08-24 02:04:49 +08:00
|
|
|
<div id='sizeDownLabel' hidden>Font size down</div>
|
|
|
|
<div id='sizeDownDesc' hidden>
|
2016-08-06 03:21:35 +08:00
|
|
|
Decreases the font size of the application.</div>
|
2016-05-06 05:14:39 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|