mirror of
https://github.com/mue/mue.git
synced 2026-07-13 12:07:45 +02:00
Make it easier to add languages and fix console error with marketplace/addons
This commit is contained in:
@@ -19,6 +19,11 @@ export default function Item(props) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
let iconsrc = 'https://external-content.duckduckgo.com/iu/?u=' + props.data.icon; // prevent console error
|
||||
if (!props.data.icon) {
|
||||
iconsrc = null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div id='item'>
|
||||
<br/>
|
||||
@@ -27,7 +32,7 @@ export default function Item(props) {
|
||||
<h1>{props.data.name}</h1>
|
||||
{props.button}
|
||||
<br/><br/>
|
||||
<img alt='product' draggable={false} src={'https://external-content.duckduckgo.com/iu/?u=' + props.data.icon} />
|
||||
<img alt='product' draggable={false} src={iconsrc} />
|
||||
<div className='informationContainer'>
|
||||
<div className='productInformation'>
|
||||
<h4>{props.language.information}</h4>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import React from 'react';
|
||||
import Dropdown from '../Dropdown';
|
||||
|
||||
const languages = require('../../../../modules/languages.json');
|
||||
|
||||
export default function LanguageSettings (props) {
|
||||
return (
|
||||
<div className='section'>
|
||||
@@ -8,13 +10,10 @@ export default function LanguageSettings (props) {
|
||||
<Dropdown
|
||||
name='language'
|
||||
id='language'
|
||||
onChange={() => localStorage.setItem('language', document.getElementById('language').value)} >
|
||||
<option className='choices' value='en'>English</option>
|
||||
<option className='choices' value='es'>Español</option>
|
||||
<option className='choices' value='fr'>Français</option>
|
||||
<option className='choices' value='nl'>Nederlands</option>
|
||||
<option className='choices' value='no'>Norsk</option>
|
||||
<option className='choices' value='ru'>Pусский</option>
|
||||
onChange={() => localStorage.setItem('language', document.getElementById('language').value)}>
|
||||
{languages.map(language =>
|
||||
<option className='choices' value={language.code} key={language.code}>{language.text}</option>
|
||||
)}
|
||||
</Dropdown>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user