-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from KasselLabs/add-donation-options-and-gtm
Add donation options buttons
- Loading branch information
Showing
7 changed files
with
216 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { useState, useCallback } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
const DONATION_AMOUNTS = { | ||
watermark: 10, | ||
'no-watermark': 20, | ||
}; | ||
|
||
export default function DonationOptions({ updatePaymentAmount }) { | ||
const [selectedOption, setSelectedOption] = useState('no-watermark'); | ||
|
||
const selectOption = useCallback((option) => { | ||
setSelectedOption(option); | ||
updatePaymentAmount(DONATION_AMOUNTS[option]); | ||
}); | ||
|
||
return ( | ||
<div className="donation-options"> | ||
<button | ||
type="button" | ||
className={classnames('option', { | ||
'-selected': 'watermark' === selectedOption, | ||
})} | ||
onClick={() => selectOption('watermark')} | ||
> | ||
<span className="title">STANDARD</span> | ||
<span className="description">Full HD Quality</span> | ||
<span className="description">MP4 Video</span> | ||
<span className="description">Video will be like in the preview</span> | ||
<span className="description"> | ||
Donate at least | ||
{' '} | ||
<b>$10</b> | ||
</span> | ||
</button> | ||
<button | ||
type="button" | ||
className={classnames('option', { | ||
'-selected': 'no-watermark' === selectedOption, | ||
})} | ||
onClick={() => selectOption('no-watermark')} | ||
> | ||
<span className="title">NO WATERMARK</span> | ||
<span className="description">Full HD Quality</span> | ||
<span className="description">MP4 Video</span> | ||
<span className="description">Video will be like in the preview</span> | ||
<span className="description">but without the watermark</span> | ||
<span className="description"> | ||
Donate at least | ||
{' '} | ||
<b>$20</b> | ||
</span> | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
DonationOptions.propTypes = { | ||
updatePaymentAmount: PropTypes.func.isRequired, | ||
}; |
Oops, something went wrong.
8ef5931
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: