From c725ad4cc364195793dcc73b628a92539d7233f8 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Thu, 15 Jul 2021 15:08:37 +0100 Subject: [PATCH] style: improve item page, update photo width/height code --- .../modals/main/marketplace/Item.jsx | 31 +++++++++---------- .../main/scss/marketplace/_buttons.scss | 3 +- .../modals/main/scss/marketplace/_main.scss | 14 +++++++-- .../widgets/background/PhotoInformation.jsx | 6 ++-- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/components/modals/main/marketplace/Item.jsx b/src/components/modals/main/marketplace/Item.jsx index bb0c806a..fea79615 100644 --- a/src/components/modals/main/marketplace/Item.jsx +++ b/src/components/modals/main/marketplace/Item.jsx @@ -45,27 +45,26 @@ export default class Item extends React.PureComponent {

{this.props.data.display_name}

-
{this.props.button} -
+

{iconsrc ? product this.setState({ showLightbox: true })}/> : null} +
+
+
    +
  • {language.version}
  • +
  • {this.props.data.version}
  • +
    +
  • {language.author}
  • +
  • {this.props.data.author}
  • +
+
+
+ {warningHTML} +
+

{language.overview}

-
-
    - {/*
  • {language.last_updated}
  • -
  • {this.props.data.updated}
  • -
    */} -
  • {language.version}
  • -
  • {this.props.data.version}
  • -
    -
  • {language.author}
  • -
  • {this.props.data.author}
  • -
-
-
- {warningHTML}
this.setState({ showLightbox: false })} isOpen={this.state.showLightbox} className='Modal lightboxmodal' overlayClassName='Overlay resetoverlay' ariaHideApp={false}> this.setState({ showLightbox: false })} img={iconsrc}/> diff --git a/src/components/modals/main/scss/marketplace/_buttons.scss b/src/components/modals/main/scss/marketplace/_buttons.scss index 01220689..e043d414 100644 --- a/src/components/modals/main/scss/marketplace/_buttons.scss +++ b/src/components/modals/main/scss/marketplace/_buttons.scss @@ -39,7 +39,8 @@ .addToMue { @extend %storebutton; - margin-top: 12px; + float: right; + margin-top: -10px; } .sideload { diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/components/modals/main/scss/marketplace/_main.scss index 07843b48..5be925ab 100644 --- a/src/components/modals/main/scss/marketplace/_main.scss +++ b/src/components/modals/main/scss/marketplace/_main.scss @@ -98,6 +98,15 @@ p.author { font-size: 40px; line-height: 20px; } + + img { + float: left; + } +} + +.side { + float: right; + margin-left: 20px; } #item>h1, @@ -107,7 +116,7 @@ p.author { p.description { margin-top: 0px; - max-width: 400px; + max-width: 800px; } .emptyMessage { @@ -136,7 +145,8 @@ p.description { } .informationContainer { - margin-top: 20px; + margin-top: 150px; + position: absolute; } .productInformation { diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index 1ec11547..d77cee19 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -52,9 +52,9 @@ export default function PhotoInformation(props) { // get resolution const img = new Image(); - img.onload = function() { - setWidth(this.width); - setHeight(this.height); + img.onload = (event) => { + setWidth(event.target.width); + setHeight(event.target.height); } img.src = props.url;