|
| 1 | +import React from 'react/addons'; |
| 2 | +import Carousel from 'nuka-carousel'; |
| 3 | +import Dialog from '../../components/dialog'; |
| 4 | +import TextBoxes from './text-box'; |
| 5 | +import Dropdown from '../dropdown'; |
| 6 | + |
| 7 | +/** |
| 8 | + * |
| 9 | + */ |
| 10 | + |
| 11 | +export default React.createClass({ |
| 12 | + mixins: [ Carousel.ControllerMixin ], |
| 13 | + getInitialState(){ |
| 14 | + return { currentSlide: null } |
| 15 | + }, |
| 16 | + |
| 17 | + componentDidMount() { |
| 18 | + this.el = document.getElementById('application'); |
| 19 | + this.el.className = 'info-view-active'; |
| 20 | + this.avatar = document.getElementById('avatar'); |
| 21 | + }, |
| 22 | + |
| 23 | + componentWillUnmount() { |
| 24 | + this.el.className = ''; |
| 25 | + }, |
| 26 | + |
| 27 | + componentDidUpdate(){ |
| 28 | + this.el.className = |
| 29 | + `info-view-active slide-${this.state.carousels.carousel.state.currentSlide}`; |
| 30 | + }, |
| 31 | + |
| 32 | + render() { |
| 33 | + let dropitems = [ |
| 34 | + { icon: 'user', content: 'Profile' }, |
| 35 | + { icon: 'language', content: 'Localization' }, |
| 36 | + { icon: 'bullhorn', content: 'Feedback' }, |
| 37 | + { icon: 'sign-out', content: 'Logout' } |
| 38 | + ]; |
| 39 | + |
| 40 | + /* |
| 41 | + Second layer arrays represent the slides. First one of the |
| 42 | + third layer arrays contain anything other than textbox-components |
| 43 | + while the second ones contain the textboxes' props. |
| 44 | + */ |
| 45 | + let objects = [ |
| 46 | + [ |
| 47 | + [ <Dropdown className='infodrop' show={true} items={dropitems} /> ], |
| 48 | + [ |
| 49 | + { content: 'Return to workspace', className: 'pos-back' }, |
| 50 | + { content: 'Edit board', className:'pos-edit' }, |
| 51 | + { content: 'Share board', className:'pos-share' }, |
| 52 | + { content: 'Export board', className:'pos-export' }, |
| 53 | + { content: 'Make tickets snap to grid', className:'pos-magnet' }, |
| 54 | + { content: 'Toggle board overview and navigate', className:'pos-minimap' }, |
| 55 | + { content: 'Edit your profile', className:'pos-profile' }, |
| 56 | + { content: 'Change operating language', className:'pos-localization' }, |
| 57 | + { content: 'Send feedback to developers', className:'pos-feedback' }, |
| 58 | + { content: 'Logout', className:'pos-logout' } |
| 59 | + ] |
| 60 | + ], |
| 61 | + [ |
| 62 | + [ <img draggable="false" className="imgTicket" src="/dist/assets/img/ticket.png"/>, |
| 63 | + <img draggable="false" className="imgEditTicket" src="/dist/assets/img/edit-ticket.png"/> ], |
| 64 | + [ |
| 65 | + { content: 'Double tap board to create a ticket.', className: 'pos-click' }, |
| 66 | + { content: 'Double tap a ticket to edit it.', className:'pos-ticket' }, |
| 67 | + { content: 'Select a color for your ticket.', className:'pos-color' }, |
| 68 | + { content: 'Edit the contents of a ticket.', className:'pos-content' } |
| 69 | + ] |
| 70 | + ], |
| 71 | + [ |
| 72 | + [ <img draggable="false" className="imgInfo" src="/dist/assets/img/edit-board.png"/> ], |
| 73 | + [ |
| 74 | + { content: 'Create or edit the name of this board.', className: 'pos-boardname' }, |
| 75 | + { content: 'Board preview.', className:'pos-boardpreview' }, |
| 76 | + { content: 'Edit the background appearance of this board.', className:'pos-boardbg' }, |
| 77 | + { content: 'Change the size of this board.', className:'pos-boardmeasures' } |
| 78 | + ] |
| 79 | + ], |
| 80 | + [ |
| 81 | + [ <img draggable="false" className="imgInfo" src="/dist/assets/img/share-board.png"/> ], |
| 82 | + [ |
| 83 | + { content: 'Hit Share to get the URL of this board for sharing.', className: 'pos-format' } |
| 84 | + ] |
| 85 | + ], |
| 86 | + [ |
| 87 | + [ <img draggable="false" className="imgInfo" src="/dist/assets/img/export-board.png"/> ], |
| 88 | + [ |
| 89 | + { content: 'Select an export format and hit Export to download the file.', className: 'pos-format' } |
| 90 | + ] |
| 91 | + ] |
| 92 | + ]; |
| 93 | + |
| 94 | + return ( |
| 95 | + <Dialog className="info" infoView={true} |
| 96 | + onDismiss={this.props.onDismiss}> |
| 97 | + <Carousel ref="carousel" className="infocarousel" |
| 98 | + data={this.setCarouselData.bind(this, 'carousel')}> |
| 99 | + |
| 100 | + {objects.map((item) => { |
| 101 | + return ( |
| 102 | + <div> |
| 103 | + <TextBoxes items={item[1]} objects={item[0]}/> |
| 104 | + </div> |
| 105 | + ); |
| 106 | + })} |
| 107 | + </Carousel> |
| 108 | + </Dialog> |
| 109 | + ); |
| 110 | + } |
| 111 | +}); |
0 commit comments