diff --git a/js/components/ascribe_detail/detail_property.js b/js/components/ascribe_detail/detail_property.js index 8b0f50b5..0191ffa9 100644 --- a/js/components/ascribe_detail/detail_property.js +++ b/js/components/ascribe_detail/detail_property.js @@ -1,9 +1,10 @@ 'use strict'; import React from 'react'; +import classNames from 'classnames'; -let DetailProperty = React.createClass({ +const DetailProperty = React.createClass({ propTypes: { label: React.PropTypes.string, value: React.PropTypes.oneOfType([ @@ -12,6 +13,7 @@ let DetailProperty = React.createClass({ React.PropTypes.element ]), separator: React.PropTypes.string, + className: React.PropTypes.string, labelClassName: React.PropTypes.string, valueClassName: React.PropTypes.string, ellipsis: React.PropTypes.bool, @@ -30,31 +32,23 @@ let DetailProperty = React.createClass({ }, render() { - let styles = {}; - const { labelClassName, - label, - separator, - valueClassName, - children, - value } = this.props; - - if(this.props.ellipsis) { - styles = { - whiteSpace: 'nowrap', - overflow: 'hidden', - textOverflow: 'ellipsis' - }; - } + const { + children, + className, + ellipsis, + label, + labelClassName, + separator, + valueClassName, + value } = this.props; return ( -
+
{label} {separator}
-
+
{children || value}
diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 141cd718..191cfe87 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -16,7 +16,7 @@ import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph import Form from './../ascribe_forms/form'; import Property from './../ascribe_forms/property'; -import EditionDetailProperty from './detail_property'; +import DetailProperty from './detail_property'; import LicenseDetail from './license_detail'; import FurtherDetails from './further_details'; @@ -57,16 +57,16 @@ let Edition = React.createClass({ return ( - + - +
-
+

{this.props.edition.title}

- - + +
0){ let statusStr = this.props.edition.status.join(', ').replace(/_/g, ' '); - status = ; + status = ; if (this.props.edition.pending_new_owner && this.props.edition.acl.acl_withdraw_transfer){ status = ( - + ); } } @@ -183,14 +183,14 @@ let EditionSummary = React.createClass({ let { actionPanelButtonListType, edition, currentUser } = this.props; return (
- - - @@ -201,14 +201,15 @@ let EditionSummary = React.createClass({ `AclInformation` would show up */} 1}> - + - +
@@ -232,56 +233,60 @@ let CoaDetails = React.createClass({ }, render() { - if(this.props.coaError) { - return ( -
-

{getLangText('There was an error generating your Certificate of Authenticity.')}

-

- {getLangText('Try to refresh the page. If this happens repeatedly, please ')} - {getLangText('contact us')}. -

-
- ); - } - if(this.props.coa && this.props.coa.url_safe) { - return ( -
-
- -
-
- - - - - - + const { coa = {}, coaError } = this.props; -
+ let coaDetailElement; + if (coaError) { + coaDetailElement = [ +

{getLangText('There was an error generating your Certificate of Authenticity.')}

, +

+ {getLangText('Try to refresh the page. If this happens repeatedly, please ')} + {getLangText('contact us')}. +

+ ]; + } else if (coa.url_safe) { + coaDetailElement = [ +
+ +
, +
+ + + + + +
- ); - } else if(typeof this.props.coa === 'string'){ - return ( -
- {this.props.coa} -
- ); - } - return ( -
- -

{getLangText("Just a sec, we\'re generating your COA")}

+ ]; + } else if (typeof coa === 'string') { + coaDetailElement = coa; + } else { + coaDetailElement = [ + , +

{getLangText("Just a sec, we're generating your COA")}

,

{getLangText('(you may leave the page)')}

+ ]; + } + + return ( +
+
+ {coaDetailElement} +
+ {/* Hide the COA and just show that it's a seperate document when printing */} +
+ {getLangText('The COA is available as a seperate document')} +
); } @@ -293,16 +298,34 @@ let SpoolDetails = React.createClass({ }, render() { - let bitcoinIdValue = ( - {this.props.edition.bitcoin_id} + const { edition: { + bitcoin_id: bitcoinId, + hash_as_address: hashAsAddress, + btc_owner_address_noprefix: bitcoinOwnerAddress + } } = this.props; + + const bitcoinIdValue = ( + + {bitcoinId} + ); - let hashOfArtwork = ( - {this.props.edition.hash_as_address} + const hashOfArtwork = ( + + {hashAsAddress} + ); - let ownerAddress = ( - {this.props.edition.btc_owner_address_noprefix} + const ownerAddress = ( + + {bitcoinOwnerAddress} + ); return ( diff --git a/js/components/ascribe_detail/history_iterator.js b/js/components/ascribe_detail/history_iterator.js index 413aeb21..03904863 100644 --- a/js/components/ascribe_detail/history_iterator.js +++ b/js/components/ascribe_detail/history_iterator.js @@ -22,7 +22,11 @@ let HistoryIterator = React.createClass({ return ( {historicalEventDescription} - {contractName} + + {contractName} + ); } else if(historicalEvent.length === 2) { diff --git a/js/components/ascribe_detail/media_container.js b/js/components/ascribe_detail/media_container.js index c6845a44..3c1e7eb9 100644 --- a/js/components/ascribe_detail/media_container.js +++ b/js/components/ascribe_detail/media_container.js @@ -114,7 +114,7 @@ let MediaContainer = React.createClass({ url={content.digital_work.url} extraData={extraData} encodingStatus={content.digital_work.isEncoding} /> -

+

- + - + {this.props.header} {this.props.subheader} {this.props.buttons} diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 7dfc9570..1aebff75 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -219,7 +219,9 @@ let PieceContainer = React.createClass({ no more than 1 key, we're hiding the `DetailProperty` actions as otherwise `AclInformation` would show up */} - + -


+

{this.state.piece.title}

diff --git a/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_dialog.js b/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_dialog.js index 25552819..db28846b 100644 --- a/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_dialog.js +++ b/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_dialog.js @@ -26,7 +26,7 @@ let FileDragAndDropDialog = React.createClass({ getDragDialog(fileClass) { if (dragAndDropAvailable) { return [ -

{getLangText('Drag %s here', fileClass)}

, +

{getLangText('Drag %s here', fileClass)}

,

{getLangText('or')}

]; } else { @@ -46,6 +46,8 @@ let FileDragAndDropDialog = React.createClass({ if (hasFiles) { return null; } else { + let dialogElement; + if (enableLocalHashing && !uploadMethod) { const currentQueryParams = getCurrentQueryParams(); @@ -55,9 +57,9 @@ let FileDragAndDropDialog = React.createClass({ const queryParamsUpload = Object.assign({}, currentQueryParams); queryParamsUpload.method = 'upload'; - return ( -
-

{getLangText('Would you rather')}

+ dialogElement = ( +
+

{getLangText('Would you rather')}

{/* The frontend in live is hosted under /app, Since `Link` is appending that base url, if its defined @@ -85,32 +87,40 @@ let FileDragAndDropDialog = React.createClass({ ); } else { if (multipleFiles) { - return ( - - {this.getDragDialog(fileClassToUpload.plural)} - - {getLangText('choose %s to upload', fileClassToUpload.plural)} - + dialogElement = [ + this.getDragDialog(fileClassToUpload.plural), + + {getLangText('choose %s to upload', fileClassToUpload.plural)} - ); + ]; } else { const dialog = uploadMethod === 'hash' ? getLangText('choose a %s to hash', fileClassToUpload.singular) : getLangText('choose a %s to upload', fileClassToUpload.singular); - return ( - - {this.getDragDialog(fileClassToUpload.singular)} - - {dialog} - + dialogElement = [ + this.getDragDialog(fileClassToUpload.singular), + + {dialog} - ); + ]; } } + + return ( +
+
+ {dialogElement} +
+ {/* Hide the uploader and just show that there's been on files uploaded yet when printing */} +

+ {getLangText('No files uploaded')} +

+
+ ); } } }); diff --git a/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_preview_image.js b/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_preview_image.js index 927a5b22..5c757121 100644 --- a/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_preview_image.js +++ b/js/components/ascribe_uploader/ascribe_file_drag_and_drop/file_drag_and_drop_preview_image.js @@ -49,7 +49,7 @@ const FileDragAndDropPreviewImage = React.createClass({ }; let actionSymbol; - + // only if assets are actually downloadable, there should be a download icon if the process is already at // 100%. If not, no actionSymbol should be displayed if(progress === 100 && areAssetsDownloadable) { @@ -68,7 +68,7 @@ const FileDragAndDropPreviewImage = React.createClass({ return (
diff --git a/js/components/footer.js b/js/components/footer.js index 31145d4b..f2e35dfc 100644 --- a/js/components/footer.js +++ b/js/components/footer.js @@ -7,7 +7,7 @@ import { getLangText } from '../utils/lang_utils'; let Footer = React.createClass({ render() { return ( -
+


api | diff --git a/js/components/header.js b/js/components/header.js index 797684ec..c16cba86 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -219,10 +219,11 @@ let Header = React.createClass({ return (

+ className="hidden-print">
); } diff --git a/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js b/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js index 26a186ca..4be15b04 100644 --- a/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js +++ b/js/components/whitelabel/wallet/components/ascribe_detail/wallet_piece_container.js @@ -25,12 +25,16 @@ let WalletPieceContainer = React.createClass({ currentUser: React.PropTypes.object.isRequired, loadPiece: React.PropTypes.func.isRequired, handleDeleteSuccess: React.PropTypes.func.isRequired, - submitButtonType: React.PropTypes.func.isRequired + submitButtonType: React.PropTypes.func.isRequired, + children: React.PropTypes.oneOfType([ + React.PropTypes.object, + React.PropTypes.array + ]) }, - + render() { - if(this.props.piece && this.props.piece.id) { + if (this.props.piece && this.props.piece.id) { return ( } subheader={ -
- - -
-
- }> +
+ + +
+
+ }> - {this.props.children}
); - } - else { + } else { return (
diff --git a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_forms/ikonotv_artist_details_form.js b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_forms/ikonotv_artist_details_form.js index 7aec7ff4..0b97c8dd 100644 --- a/js/components/whitelabel/wallet/components/ikonotv/ikonotv_forms/ikonotv_artist_details_form.js +++ b/js/components/whitelabel/wallet/components/ikonotv/ikonotv_forms/ikonotv_artist_details_form.js @@ -60,9 +60,8 @@ let IkonotvArtistDetailsForm = React.createClass({ render() { let buttons, spinner, heading; let { isInline, handleSuccess } = this.props; - - if(!isInline) { + if (!isInline) { buttons = (