|
| 1 | +import React from 'react' |
| 2 | +import ServiceContext from './service_context.js'; |
| 3 | +import ModelBinding from './model_binding.js'; |
| 4 | + |
| 5 | +class AboutBox_ extends React.PureComponent |
| 6 | +{ |
| 7 | + static contextType = ServiceContext; |
| 8 | + |
| 9 | + constructor(props, context) |
| 10 | + { |
| 11 | + super(props, context); |
| 12 | + |
| 13 | + this.state = this.getStateFromModel(); |
| 14 | + } |
| 15 | + |
| 16 | + getStateFromModel() |
| 17 | + { |
| 18 | + const { title, version, pluginVersion } = this.context.playerModel.info; |
| 19 | + return { title, version, pluginVersion }; |
| 20 | + } |
| 21 | + |
| 22 | + render() |
| 23 | + { |
| 24 | + const { title, version, pluginVersion } = this.state; |
| 25 | + |
| 26 | + return ( |
| 27 | + <div className='about-box'> |
| 28 | + <p> |
| 29 | + Beefweb v{pluginVersion} @ {title} v{version} |
| 30 | + </p> |
| 31 | + <p> |
| 32 | + <a href='https://hyperblast.org/donate/' className='about-box-link' target='_blank'>Donate to author</a> |
| 33 | + <a href='third-party-licenses.txt' className='about-box-link' target='_blank'>Third-party licenses</a> |
| 34 | + <a href='https://hyperblast.org/beefweb/api/' className='about-box-link' target='_blank'>API documentation</a> |
| 35 | + </p> |
| 36 | + <p className='license-text'> |
| 37 | + Copyright 2015-2024 Hyperblast<br/><br/> |
| 38 | + |
| 39 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 40 | + of this software and associated documentation files (the "Software"), to deal |
| 41 | + in the Software without restriction, including without limitation the rights |
| 42 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 43 | + copies of the Software, and to permit persons to whom the Software is |
| 44 | + furnished to do so, subject to the following conditions:<br/><br/> |
| 45 | + |
| 46 | + The above copyright notice and this permission notice shall be included in |
| 47 | + all copies or substantial portions of the Software.<br/><br/> |
| 48 | + |
| 49 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 50 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 51 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 52 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 53 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 54 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 55 | + THE SOFTWARE. |
| 56 | + </p> |
| 57 | + </div> |
| 58 | + ); |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +export default ModelBinding(AboutBox_, { playerModel: 'change'}); |
0 commit comments