import variables from 'modules/variables'; import { PureComponent } from 'react'; import { MdEmail, MdContactPage } from 'react-icons/md'; import { FaDiscord, FaTwitter } from 'react-icons/fa'; import { SiGithubsponsors, SiLiberapay, SiKofi, SiPatreon } from 'react-icons/si'; import { BiDonateHeart } from 'react-icons/bi'; import Tooltip from 'components/helpers/tooltip/Tooltip'; import SettingsItem from '../SettingsItem'; import other_contributors from 'modules/other_contributors.json'; export default class About extends PureComponent { getMessage = (text) => variables.language.getMessage(variables.languagecode, text); constructor() { super(); this.state = { contributors: [], sponsors: [], other_contributors: [], photographers: this.getMessage('modals.main.loading'), update: this.getMessage('modals.main.settings.sections.about.version.checking_update'), loading: this.getMessage('modals.main.loading'), image: localStorage.getItem('theme') === 'dark' ? './././icons/mue_dark.svg' : './././icons/mue_light.svg', }; this.controller = new AbortController(); } async getGitHubData() { let contributors, sponsors, photographers, versionData; try { versionData = await ( await fetch( variables.constants.GITHUB_URL + '/repos/' + variables.constants.ORG_NAME + '/' + variables.constants.REPO_NAME + '/releases', { signal: this.controller.signal }, ) ).json(); contributors = await ( await fetch( variables.constants.GITHUB_URL + '/repos/' + variables.constants.ORG_NAME + '/' + variables.constants.REPO_NAME + '/contributors', { signal: this.controller.signal }, ) ).json(); sponsors = ( await ( await fetch(variables.constants.SPONSORS_URL + '/list', { signal: this.controller.signal, }) ).json() ).sponsors; photographers = await ( await fetch(variables.constants.API_URL + '/images/photographers', { signal: this.controller.signal, }) ).json(); } catch (e) { if (this.controller.signal.aborted === true) { return; } return this.setState({ update: this.getMessage('modals.main.settings.sections.about.version.error.title'), loading: this.getMessage('modals.main.settings.sections.about.version.error.description'), }); } if (sponsors.length === 0) { sponsors = [{ handle: 'empty' }]; } if (this.controller.signal.aborted === true) { return; } const newVersion = versionData[0].tag_name; let update = this.getMessage('modals.main.settings.sections.about.version.no_update'); if ( Number(variables.constants.VERSION.replaceAll('.', '')) < Number(newVersion.replaceAll('.', '')) ) { update = `${this.getMessage( 'modals.main.settings.sections.about.version.update_available', )}: ${newVersion}`; } this.setState({ // exclude bots contributors: contributors.filter((contributor) => !contributor.login.includes('bot')), sponsors, update, other_contributors, photographers: photographers.sort().join(', '), loading: null, }); } componentDidMount() { if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') { this.setState({ update: this.getMessage('modals.main.settings.sections.about.version.checking_update'), loading: this.getMessage('modals.main.marketplace.offline.description'), }); return; } this.getGitHubData(); } componentWillUnmount() { // stop making requests this.controller.abort(); } render() { return ( <> {this.getMessage('modals.main.settings.sections.about.title')}
Logo {this.getMessage('modals.main.settings.sections.about.version.title')}{' '} {variables.constants.VERSION} ({this.state.update}) {this.getMessage('modals.main.settings.sections.about.copyright')}{' '} {variables.constants.COPYRIGHT_YEAR}-{new Date().getFullYear()}{' '} {variables.constants.COPYRIGHT_NAME} {' '} ({variables.constants.COPYRIGHT_LICENSE}) {this.getMessage('modals.welcome.sections.privacy.links.privacy_policy')}
{this.getMessage('modals.main.settings.sections.about.contact_us')}
Form
{this.getMessage('modals.main.settings.sections.about.support_mue')}

As Mue is entirely free, we rely on donations to cover pay the server bills and fund development

Donate
{this.getMessage('modals.main.settings.sections.about.resources_used.title')} Pexels ,{' '} Unsplash {' '} ({this.getMessage('modals.main.settings.sections.about.resources_used.bg_images')})
{this.getMessage('modals.main.settings.sections.about.contributors')}

{this.state.loading}

{this.state.contributors.map(({ login, id }) => ( {login} ))} { // for those who contributed without opening a pull request this.state.other_contributors.map(({ login, avatar_url }) => ( {login} )) }
{this.getMessage('modals.main.settings.sections.about.supporters')}

{this.state.loading}

{this.state.sponsors.map(({ handle, avatar }) => { if (handle === 'empty') { return (

{this.getMessage('modals.main.settings.sections.about.no_supporters')}

); } return ( {handle} ); })}
{this.getMessage('modals.main.settings.sections.about.photographers')} {this.state.photographers}
); } }