2021-02-27 13:46:41 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
|
|
|
2021-02-27 18:54:29 +00:00
|
|
|
import * as Constants from '../../../../modules/constants';
|
|
|
|
|
2021-02-28 16:18:17 +00:00
|
|
|
const other_contributors = require('../../../../modules/other_contributors.json');
|
|
|
|
|
2021-02-27 13:46:41 +00:00
|
|
|
export default class About extends React.PureComponent {
|
|
|
|
constructor(...args) {
|
|
|
|
super(...args);
|
|
|
|
this.state = {
|
2021-02-27 18:54:29 +00:00
|
|
|
contributors: [],
|
2021-03-18 13:41:42 +00:00
|
|
|
sponsors: [],
|
|
|
|
update: this.props.language.version.checking_update
|
2021-02-27 13:46:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-27 18:54:29 +00:00
|
|
|
async getGitHubData() {
|
|
|
|
const contributors = await (await fetch('https://api.github.com/repos/mue/mue/contributors')).json();
|
|
|
|
const versionData = await (await fetch('https://api.github.com/repos/mue/mue/releases')).json();
|
2021-03-18 13:41:42 +00:00
|
|
|
const { sponsors } = await (await fetch(Constants.SPONSORS_URL + '/list')).json();
|
2021-02-27 18:54:29 +00:00
|
|
|
|
2021-03-17 22:01:07 +00:00
|
|
|
let updateMsg = this.props.language.version.no_update;
|
2021-02-27 18:54:29 +00:00
|
|
|
let version = versionData[0].tag_name;
|
|
|
|
if (version !== '5.0' && version !== '4.1') {
|
2021-03-17 22:01:07 +00:00
|
|
|
updateMsg = `${this.props.language.version.update_available}: ${version}`;
|
2021-02-27 18:54:29 +00:00
|
|
|
}
|
2021-02-27 13:46:41 +00:00
|
|
|
|
2021-03-17 13:01:53 +00:00
|
|
|
this.setState({
|
2021-03-18 13:41:42 +00:00
|
|
|
contributors: contributors.filter((contributor) => !contributor.login.includes('bot')),
|
|
|
|
sponsors: sponsors,
|
2021-03-17 13:01:53 +00:00
|
|
|
update: updateMsg
|
2021-02-27 13:46:41 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
2021-02-27 18:54:29 +00:00
|
|
|
this.getGitHubData();
|
2021-02-27 13:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
2021-03-17 22:01:07 +00:00
|
|
|
<h2>{this.props.language.title}</h2>
|
2021-03-17 13:01:53 +00:00
|
|
|
<img draggable='false' style={{'height': '100px', 'width': 'auto'}} src='https://raw.githubusercontent.com/mue/branding/master/logo/logo_horizontal.png' alt='Mue logo'></img>
|
2021-03-17 22:01:07 +00:00
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<h3>{this.props.language.contributors}</h3>
|
2021-03-17 13:01:53 +00:00
|
|
|
{this.state.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>
|
|
|
|
)}
|
2021-03-17 14:41:50 +00:00
|
|
|
{// for those who contributed without opening a pull request
|
|
|
|
other_contributors.map((item) =>
|
2021-03-17 13:01:53 +00:00
|
|
|
<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>
|
|
|
|
)}
|
2021-03-17 22:01:07 +00:00
|
|
|
<h3>{this.props.language.supporters}</h3>
|
2021-03-18 13:41:42 +00:00
|
|
|
{this.state.sponsors.map((item) =>
|
|
|
|
<Tooltip title={item.handle} placement='top' key={item.handle}>
|
|
|
|
<a href={item.profile} target='_blank' rel='noopener noreferrer'><img draggable='false' className='abouticon' src={item.avatar + '&size=256'} alt={item.handle}></img></a>
|
|
|
|
</Tooltip>
|
|
|
|
)}
|
2021-02-27 13:46:41 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2021-03-17 13:01:53 +00:00
|
|
|
}
|