diff --git a/frontend/client/components/ContributionModal/PaymentInfo.tsx b/frontend/client/components/ContributionModal/PaymentInfo.tsx index f7731951..8a2acb55 100644 --- a/frontend/client/components/ContributionModal/PaymentInfo.tsx +++ b/frontend/client/components/ContributionModal/PaymentInfo.tsx @@ -47,13 +47,11 @@ export default class PaymentInfo extends React.Component { return (
- {text || ( - <> - Thank you for contributing! Just send using whichever method works best for - you, and we'll let you know when your contribution has been confirmed. - - )} - {/* TODO: Help / FAQ page for sending */} Need help sending? Click here. + {text || + ` + Thank you for contributing! Just send using whichever method works best for + you, and we'll let you know when your contribution has been confirmed. + `}
{ @@ -58,9 +57,10 @@ export class ProposalDetail extends React.Component { isBodyOverflowing: false, isUpdateOpen: false, isCancelOpen: false, - bodyId: `body-${Math.floor(Math.random() * 1000000)}`, }; + bodyEl: HTMLElement | null = null; + componentDidMount() { // always refresh from server this.props.fetchProposal(this.props.proposalId); @@ -87,13 +87,7 @@ export class ProposalDetail extends React.Component { render() { const { user, detail: proposal, isPreview, detailError } = this.props; - const { - isBodyExpanded, - isBodyOverflowing, - isCancelOpen, - isUpdateOpen, - bodyId, - } = this.state; + const { isBodyExpanded, isBodyOverflowing, isCancelOpen, isUpdateOpen } = this.state; const showExpand = !isBodyExpanded && isBodyOverflowing; const wrongProposal = proposal && proposal.proposalId !== this.props.proposalId; @@ -209,7 +203,7 @@ export class ProposalDetail extends React.Component {
(this.bodyEl = el)} className={classnames({ ['Proposal-top-main-block-bodyText']: true, ['is-expanded']: isBodyExpanded, @@ -291,20 +285,17 @@ export class ProposalDetail extends React.Component { }; private checkBodyOverflow = () => { - const { isBodyExpanded, bodyId, isBodyOverflowing } = this.state; - if (isBodyExpanded) { + const { isBodyExpanded, isBodyOverflowing } = this.state; + if (isBodyExpanded || !this.bodyEl) { return; } - // Use id instead of ref because styled component ref doesn't return html element - const bodyEl = document.getElementById(bodyId); - if (!bodyEl) { - return; - } - - if (isBodyOverflowing && bodyEl.scrollHeight <= bodyEl.clientHeight) { + if (isBodyOverflowing && this.bodyEl.scrollHeight <= this.bodyEl.clientHeight) { this.setState({ isBodyOverflowing: false }); - } else if (!isBodyOverflowing && bodyEl.scrollHeight > bodyEl.clientHeight) { + } else if ( + !isBodyOverflowing && + this.bodyEl.scrollHeight > this.bodyEl.clientHeight + ) { this.setState({ isBodyOverflowing: true }); } }; diff --git a/frontend/client/utils/api.ts b/frontend/client/utils/api.ts index 03d695bc..7caa30fa 100644 --- a/frontend/client/utils/api.ts +++ b/frontend/client/utils/api.ts @@ -145,6 +145,12 @@ export function massageSerializedState(state: AppState) { (state.proposal.detail.funded as any) as string, 16, ); + if (state.proposal.detail.rfp && state.proposal.detail.rfp.bounty) { + state.proposal.detail.rfp.bounty = new BN( + (state.proposal.detail.rfp.bounty as any) as string, + 16, + ); + } } // proposals state.proposal.page.items = state.proposal.page.items.map(p => ({