fix: make donate modal scrollable (#36761)
* fix: make donate modal scrollable * fix: make text more readable on donate modal Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
				
			|||||||
.donation-modal {
 | 
					.donation-modal {
 | 
				
			||||||
  font-size: 0.8rem;
 | 
					  overflow-y: auto;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.donation-modal p {
 | 
					.donation-modal p {
 | 
				
			||||||
@@ -16,9 +16,6 @@
 | 
				
			|||||||
  font-size: 1.2rem;
 | 
					  font-size: 1.2rem;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.donation-modal .donation-form {
 | 
					 | 
				
			||||||
  width: 60%;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
.donation-form {
 | 
					.donation-form {
 | 
				
			||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
  flex-direction: column;
 | 
					  flex-direction: column;
 | 
				
			||||||
@@ -27,6 +24,23 @@
 | 
				
			|||||||
  margin: 0 auto;
 | 
					  margin: 0 auto;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@media (max-width: 500px) {
 | 
				
			||||||
 | 
					  .donation-form {
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.donation-modal .btn-link {
 | 
				
			||||||
 | 
					  border: none;
 | 
				
			||||||
 | 
					  text-decoration: underline;
 | 
				
			||||||
 | 
					  background: transparent;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.donation-modal .btn-link:hover {
 | 
				
			||||||
 | 
					  background: var(--tertiary-background);
 | 
				
			||||||
 | 
					  text-decoration: none;
 | 
				
			||||||
 | 
					  color: inherit;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.donation-elements {
 | 
					.donation-elements {
 | 
				
			||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
  flex-direction: column;
 | 
					  flex-direction: column;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,9 @@ import {
 | 
				
			|||||||
  ControlLabel,
 | 
					  ControlLabel,
 | 
				
			||||||
  Form,
 | 
					  Form,
 | 
				
			||||||
  FormControl,
 | 
					  FormControl,
 | 
				
			||||||
  FormGroup
 | 
					  FormGroup,
 | 
				
			||||||
 | 
					  Row,
 | 
				
			||||||
 | 
					  Col
 | 
				
			||||||
} from '@freecodecamp/react-bootstrap';
 | 
					} from '@freecodecamp/react-bootstrap';
 | 
				
			||||||
import { injectStripe } from 'react-stripe-elements';
 | 
					import { injectStripe } from 'react-stripe-elements';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -162,34 +164,35 @@ class DonateForm extends Component {
 | 
				
			|||||||
  renderDonateForm() {
 | 
					  renderDonateForm() {
 | 
				
			||||||
    const { isFormValid } = this.state;
 | 
					    const { isFormValid } = this.state;
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
      <div>
 | 
					      <Row>
 | 
				
			||||||
        <Form className='donation-form' onSubmit={this.handleSubmit}>
 | 
					        <Col sm={10} smOffset={1} xs={12}>
 | 
				
			||||||
          <FormGroup className='donation-email-container'>
 | 
					          <Form className='donation-form' onSubmit={this.handleSubmit}>
 | 
				
			||||||
            <ControlLabel>
 | 
					            <FormGroup className='donation-email-container'>
 | 
				
			||||||
              Email (we'll send you a tax-deductible donation receipt):
 | 
					              <ControlLabel>
 | 
				
			||||||
            </ControlLabel>
 | 
					                Email (we'll send you a tax-deductible donation receipt):
 | 
				
			||||||
            <FormControl
 | 
					              </ControlLabel>
 | 
				
			||||||
              onChange={this.handleEmailChange}
 | 
					              <FormControl
 | 
				
			||||||
              placeholder='me@example.com'
 | 
					                onChange={this.handleEmailChange}
 | 
				
			||||||
              required={true}
 | 
					                placeholder='me@example.com'
 | 
				
			||||||
              type='text'
 | 
					                required={true}
 | 
				
			||||||
              value={this.getUserEmail()}
 | 
					                type='text'
 | 
				
			||||||
            />
 | 
					                value={this.getUserEmail()}
 | 
				
			||||||
          </FormGroup>
 | 
					              />
 | 
				
			||||||
          <StripeCardForm getValidationState={this.getValidationState} />
 | 
					            </FormGroup>
 | 
				
			||||||
          <Button
 | 
					            <StripeCardForm getValidationState={this.getValidationState} />
 | 
				
			||||||
            block={true}
 | 
					            <Button
 | 
				
			||||||
            bsSize='lg'
 | 
					              block={true}
 | 
				
			||||||
            bsStyle='primary'
 | 
					              bsStyle='primary'
 | 
				
			||||||
            disabled={!isFormValid}
 | 
					              disabled={!isFormValid}
 | 
				
			||||||
            id='confirm-donation-btn'
 | 
					              id='confirm-donation-btn'
 | 
				
			||||||
            type='submit'
 | 
					              type='submit'
 | 
				
			||||||
          >
 | 
					            >
 | 
				
			||||||
            Confirm your donation of $5 / month
 | 
					              Confirm your donation of $5 / month
 | 
				
			||||||
          </Button>
 | 
					            </Button>
 | 
				
			||||||
          <Spacer />
 | 
					            <Spacer />
 | 
				
			||||||
        </Form>
 | 
					          </Form>
 | 
				
			||||||
      </div>
 | 
					        </Col>
 | 
				
			||||||
 | 
					      </Row>
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@ import React from 'react';
 | 
				
			|||||||
import PropTypes from 'prop-types';
 | 
					import PropTypes from 'prop-types';
 | 
				
			||||||
import { connect } from 'react-redux';
 | 
					import { connect } from 'react-redux';
 | 
				
			||||||
import { createSelector } from 'reselect';
 | 
					import { createSelector } from 'reselect';
 | 
				
			||||||
 | 
					import { Row, Col } from '@freecodecamp/react-bootstrap';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { activeDonationsSelector } from '../../../redux';
 | 
					import { activeDonationsSelector } from '../../../redux';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -17,18 +18,20 @@ const mapStateToProps = createSelector(
 | 
				
			|||||||
const DonateText = ({ activeDonations }) => {
 | 
					const DonateText = ({ activeDonations }) => {
 | 
				
			||||||
  const donationsLocale = activeDonations.toLocaleString();
 | 
					  const donationsLocale = activeDonations.toLocaleString();
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <div className='text-center'>
 | 
					    <Row>
 | 
				
			||||||
      <p>
 | 
					      <Col sm={10} smOffset={1} xs={12}>
 | 
				
			||||||
        freeCodeCamp.org is a tiny nonprofit that's helping millions of people
 | 
					        <p>
 | 
				
			||||||
        learn to code for free.
 | 
					          freeCodeCamp.org is a tiny nonprofit that's helping millions of people
 | 
				
			||||||
      </p>
 | 
					          learn to code for free.
 | 
				
			||||||
      <p>
 | 
					        </p>
 | 
				
			||||||
        Join <strong>{donationsLocale}</strong> supporters.
 | 
					        <p>
 | 
				
			||||||
      </p>
 | 
					          Join <strong>{donationsLocale}</strong> supporters.
 | 
				
			||||||
      <p>
 | 
					        </p>
 | 
				
			||||||
        Your $5 / month donation will help keep tech education free and open.
 | 
					        <p>
 | 
				
			||||||
      </p>
 | 
					          Your $5 / month donation will help keep tech education free and open.
 | 
				
			||||||
    </div>
 | 
					        </p>
 | 
				
			||||||
 | 
					      </Col>
 | 
				
			||||||
 | 
					    </Row>
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user