mirror of
https://github.com/mue/mue.git
synced 2026-07-20 15:34:10 +02:00
feat: better dropdowns, about section etc
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import Tooltip from '@material-ui/core/Tooltip';
|
||||
import * as Constants from '../../../../modules/constants';
|
||||
|
||||
const other_contributors = require('../../../../modules/other_contributors.json');
|
||||
const { version } = require('../../../../../package.json');
|
||||
|
||||
export default class About extends React.PureComponent {
|
||||
constructor(...args) {
|
||||
@@ -12,6 +13,7 @@ export default class About extends React.PureComponent {
|
||||
this.state = {
|
||||
contributors: [],
|
||||
sponsors: [],
|
||||
other_contributors: [],
|
||||
update: this.props.language.version.checking_update
|
||||
}
|
||||
}
|
||||
@@ -21,17 +23,18 @@ export default class About extends React.PureComponent {
|
||||
const { sponsors } = await (await fetch(Constants.SPONSORS_URL + '/list')).json();
|
||||
|
||||
const versionData = await (await fetch('https://api.github.com/repos/mue/mue/releases')).json();
|
||||
const version = versionData[0].tag_name;
|
||||
const newVersion = versionData[0].tag_name;
|
||||
|
||||
let updateMsg = this.props.language.version.no_update;
|
||||
if (version !== '5.0' && version !== '4.1') {
|
||||
updateMsg = `${this.props.language.version.update_available}: ${version}`;
|
||||
if (version < newVersion) {
|
||||
updateMsg = `${this.props.language.version.update_available}: ${newVersion}`;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
contributors: contributors.filter((contributor) => !contributor.login.includes('bot')),
|
||||
sponsors: sponsors,
|
||||
update: updateMsg
|
||||
update: updateMsg,
|
||||
other_contributors: other_contributors
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +55,7 @@ export default class About extends React.PureComponent {
|
||||
<h2>{this.props.language.title}</h2>
|
||||
<img draggable='false' style={{'height': '100px', 'width': 'auto'}} src='https://raw.githubusercontent.com/mue/branding/master/logo/logo_horizontal.png' alt='Mue logo'></img>
|
||||
<p>{this.props.language.copyright} 2018-{new Date().getFullYear()} Mue Tab (BSD-3 License)</p>
|
||||
<p>{this.props.language.version.title} {Constants.VERSION} ({this.state.update})</p>
|
||||
<p>{this.props.language.version.title} {version} ({this.state.update})</p>
|
||||
<h3>{this.props.language.resources_used.title}</h3>
|
||||
<p>Pexels ({this.props.language.resources_used.bg_images})</p>
|
||||
<p>Google ({this.props.language.resources_used.pin_icon})</p>
|
||||
@@ -63,8 +66,8 @@ export default class About extends React.PureComponent {
|
||||
<a href={'https://github.com/' + item.login} target='_blank' rel='noopener noreferrer'><img draggable='false' className='abouticon' src={item.avatar_url + '&size=256'} alt={item.login}></img></a>
|
||||
</Tooltip>
|
||||
)}
|
||||
{// for those who contributed without opening a pull request
|
||||
other_contributors.map((item) =>
|
||||
{ // for those who contributed without opening a pull request
|
||||
this.state.other_contributors.map((item) =>
|
||||
<Tooltip title={item.login} placement='top' key={item.login}>
|
||||
<a href={'https://github.com/' + item.login} target='_blank' rel='noopener noreferrer'><img draggable='false' className='abouticon' src={item.avatar_url + '&size=256'} alt={item.login}></img></a>
|
||||
</Tooltip>
|
||||
|
||||
Reference in New Issue
Block a user