This commit is contained in:
David Ralph
2020-08-26 22:19:36 +01:00
parent 348d3e8578
commit 2814174a38
4 changed files with 14 additions and 10 deletions

View File

@@ -15,7 +15,6 @@
"license": "BSD-3-Clause",
"version": "4.0.0",
"dependencies": {
"@eartharoid/dtf": "^1.0.7",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@muetab/quotes": "^1.0.0",

View File

@@ -1,7 +1,6 @@
import React from 'react';
import LocalMallIcon from '@material-ui/icons/LocalMall';
import { toast } from 'react-toastify';
import dtf from '@eartharoid/dtf';
import Item from './marketplace/Item';
import MarketplaceFunctions from '../../modules/marketplaceFunctions';
@@ -31,7 +30,7 @@ export default class Addons extends React.PureComponent {
name: info.data.name,
author: info.data.author,
description: MarketplaceFunctions.urlParser(info.data.description.replace(/\n/g, '<br>')),
updated: dtf('n_D MMM YYYY', info.updated, 'en-GB'),
updated: info.updated,
version: info.data.version,
icon: info.data.screenshot_url
}

View File

@@ -2,7 +2,6 @@ import React from 'react';
import WifiOffIcon from '@material-ui/icons/WifiOff';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import { toast } from 'react-toastify';
import dtf from '@eartharoid/dtf';
import Item from './marketplace/Item';
import MarketplaceFunctions from '../../modules/marketplaceFunctions';
import * as Constants from '../../modules/constants';
@@ -80,7 +79,7 @@ export default class Marketplace extends React.PureComponent {
name: info.data.name,
author: info.data.author,
description: MarketplaceFunctions.urlParser(info.data.description.replace(/\n/g, '<br>')),
updated: dtf('n_D MMM YYYY', info.updated, 'en-GB'),
updated: info.updated,
version: info.data.version,
icon: info.data.screenshot_url
}

View File

@@ -6,8 +6,10 @@ export default class Update extends React.PureComponent {
super(...args);
this.state = {
title: this.props.language.title,
date: '26/08/2020',
content: this.props.language.title
date: '???',
content: this.props.language.title,
url: '',
author: 'Mue'
};
}
@@ -22,7 +24,11 @@ export default class Update extends React.PureComponent {
data = await data.json();
this.setState({
title: data.title,
content: data.content
content: data.content,
date: data.published,
image: data.image,
url: data.url,
author: data.author
});
} catch (e) { // If it fails, we send an error
this.setState({
@@ -41,8 +47,9 @@ export default class Update extends React.PureComponent {
return <div className='updateContent'>
<span className='closeModal' onClick={this.props.modalClose}>&times;</span>
<h1 style={{ 'marginBottom':'-10px' }} dangerouslySetInnerHTML={{__html: this.state.title}}></h1>
<h5 style={{ 'lineHeight':'0px' }}> By Mue <span dangerouslySetInnerHTML={{__html: this.state.date}}></span></h5>
<p dangerouslySetInnerHTML={{__html: this.state.content}}></p>
<h5 style={{ 'lineHeight':'0px' }}> By {this.state.author} {this.state.date}</h5>
<img src={this.state.image} alt='Update'></img>
<p dangerouslySetInnerHTML={{__html: this.state.content + `<br/><p>Read on the blog here: <a href='${this.state.url}'>${this.state.url}</a></p>`}}></p>
</div>;
}
}