diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index b1816b6a..81746096 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -231,56 +231,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')} +
); } diff --git a/sass/ascribe_print.scss b/sass/ascribe_print.scss index f2abeb80..6baa40af 100644 --- a/sass/ascribe_print.scss +++ b/sass/ascribe_print.scss @@ -24,4 +24,10 @@ width: 50% !important; float: right !important; } + + // Restyle COA + .ascribe-coa-print-placeholder { + padding: 0 1.5em 1em 1.5em; + margin: 0; + } }