fix(donate): rename donate to donates in config
parent
aded066b91
commit
4b1728e696
|
@ -47,6 +47,11 @@ module.exports = class extends Migration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(result.donate) && result.donate.length) {
|
||||||
|
result.donates = result.donate;
|
||||||
|
delete result.donate;
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(result.widgets) && result.widgets.length) {
|
if (Array.isArray(result.widgets) && result.widgets.length) {
|
||||||
for (const widget of result.widgets) {
|
for (const widget of result.widgets) {
|
||||||
if (Object.prototype.hasOwnProperty.call(widget, 'type')) {
|
if (Object.prototype.hasOwnProperty.call(widget, 'type')) {
|
||||||
|
|
|
@ -5,15 +5,15 @@ module.exports = class extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { config, helper } = this.props;
|
const { config, helper } = this.props;
|
||||||
const { __ } = helper;
|
const { __ } = helper;
|
||||||
const { donate = [] } = config;
|
const { donates = [] } = config;
|
||||||
if (!Array.isArray(donate) || !donate.length) {
|
if (!Array.isArray(donates) || !donates.length) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return <div class="card">
|
return <div class="card">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<h3 class="menu-label has-text-centered">{__('donate.title')}</h3>
|
<h3 class="menu-label has-text-centered">{__('donate.title')}</h3>
|
||||||
<div class="buttons is-centered">
|
<div class="buttons is-centered">
|
||||||
{donate.map(service => {
|
{donates.map(service => {
|
||||||
const type = service.type;
|
const type = service.type;
|
||||||
if (typeof type === 'string') {
|
if (typeof type === 'string') {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue