import React from 'react'; 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) { super(...args); this.state = { contributors: [], sponsors: [], other_contributors: [], update: this.props.language.version.checking_update } } async getGitHubData() { const contributors = await (await fetch('https://api.github.com/repos/mue/mue/contributors')).json(); 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 newVersion = versionData[0].tag_name; let updateMsg = this.props.language.version.no_update; 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, other_contributors: other_contributors }); } componentDidMount() { if (localStorage.getItem('offlineMode') === 'true') { this.setState({ update: this.props.language.version.offline_mode }); return; } this.getGitHubData(); } render() { return (

{this.props.language.title}

Mue logo

{this.props.language.copyright} 2018-{new Date().getFullYear()} Mue Tab (BSD-3 License)

{this.props.language.version.title} {version} ({this.state.update})

{this.props.language.resources_used.title}

Pexels ({this.props.language.resources_used.bg_images})

Google ({this.props.language.resources_used.pin_icon})

Undraw ({this.props.language.resources_used.welcome_img})

{this.props.language.contributors}

{this.state.contributors.map((item) => {item.login} )} { // for those who contributed without opening a pull request this.state.other_contributors.map((item) => {item.login} )}

{this.props.language.supporters}

{this.state.sponsors.map((item) => {item.handle} )}
); } }