From 1dc5e7375ba867735ebe58910afd38901dec576f Mon Sep 17 00:00:00 2001 From: David Ralph Date: Mon, 3 May 2021 11:10:04 +0100 Subject: [PATCH] fix: search bar and add quote pack api support back --- src/components/modals/main/marketplace/Item.jsx | 4 +++- src/components/modals/main/marketplace/sections/Added.jsx | 3 ++- src/components/widgets/quote/Quote.jsx | 4 ++-- src/components/widgets/search/search.scss | 8 ++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/modals/main/marketplace/Item.jsx b/src/components/modals/main/marketplace/Item.jsx index 901bb33c..1009e879 100644 --- a/src/components/modals/main/marketplace/Item.jsx +++ b/src/components/modals/main/marketplace/Item.jsx @@ -19,8 +19,9 @@ export default class Item extends React.PureComponent { let warningHTML; // For some reason it breaks sometimes so we use try/catch + console.log(this.props.data) try { - if (this.props.content.content.data.quote_api) { + if (this.props.data.quote_api) { warningHTML = (
+
{warningHTML} this.setState({ showLightbox: false })} isOpen={this.state.showLightbox} className='Modal lightboxmodal' overlayClassName='Overlay resetoverlay' ariaHideApp={false}> diff --git a/src/components/modals/main/marketplace/sections/Added.jsx b/src/components/modals/main/marketplace/sections/Added.jsx index be4b58db..b4e52deb 100644 --- a/src/components/modals/main/marketplace/sections/Added.jsx +++ b/src/components/modals/main/marketplace/sections/Added.jsx @@ -48,7 +48,8 @@ export default class Added extends React.PureComponent { description: MarketplaceFunctions.urlParser(info.description.replace(/\n/g, '
')), //updated: info.updated, version: info.version, - icon: info.screenshot_url + icon: info.screenshot_url, + quote_api: info.quote_api || null }, button: this.buttons.uninstall, display: { diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 250d2a9c..25bc84d6 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -73,8 +73,8 @@ export default class Quote extends React.PureComponent { try { const data = await (await fetch(quotePackAPI.url)).json(); return this.setState({ - quote: '"' + data.quote + '"', - author: quotePackAPI.author || data.author, + quote: '"' + data[quotePackAPI.quote] + '"', + author: data[quotePackAPI.author] || quotePackAPI.author, type: 'quote_pack' }); } catch (e) { diff --git a/src/components/widgets/search/search.scss b/src/components/widgets/search/search.scss index 358f060b..f84e7fb7 100644 --- a/src/components/widgets/search/search.scss +++ b/src/components/widgets/search/search.scss @@ -61,5 +61,13 @@ &:focus { background-color: rgba(0, 0, 0, 0.5); } + + &::-webkit-input-placeholder { + color: white; + } + + &::-moz-placeholder { + color: white; + } } } \ No newline at end of file