81eddb2b5d
* Rearrange fields * Autocomplete title * Fix class position * Hide deposit behind advanced settings * Redesign additional options * Redesign price section * Update price section * Redesign tags section * Fix title edit * Make with dynamic * Redesign thumbnail section * Redesign description section * Resedign file section * Polish sections * Adjust help text * Clear title on form reset * Adjust price section * Fix help color in light theme * Polish * Mobile adjustments * More mobile adjustments * Remove border-bottom from publish rows * Redesign date section * Adjust some details * Adjust clear button * Adjust channel selector on mobile * Adjust post save button position * Adjust browse button color * Adjust channel picker on mobile * Eenable announcement page * Remove file title, remove space, redesign licence section * Fix edit form, existing claim warning, missing title warning * Adjust light theme * Adjust icon collor in button
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
// @flow
|
|
import React from 'react';
|
|
import { FormField, FormFieldPrice } from 'component/common/form';
|
|
import Card from 'component/common/card';
|
|
|
|
type Props = {
|
|
contentIsFree: boolean,
|
|
fee: Fee,
|
|
disabled: boolean,
|
|
updatePublishForm: ({}) => void,
|
|
};
|
|
|
|
function PublishPrice(props: Props) {
|
|
const { contentIsFree, fee, updatePublishForm, disabled } = props;
|
|
|
|
return (
|
|
<>
|
|
<h2 className="card__title">{__('Price')}</h2>
|
|
<Card
|
|
className="card--publish-section card--price"
|
|
actions={
|
|
<React.Fragment>
|
|
<FormField
|
|
type="radio"
|
|
name="content_free"
|
|
label={__('Free')}
|
|
checked={contentIsFree}
|
|
disabled={disabled}
|
|
onChange={() => updatePublishForm({ contentIsFree: true })}
|
|
/>
|
|
|
|
<FormField
|
|
type="radio"
|
|
name="content_cost"
|
|
label={__('Add a price to this file')}
|
|
checked={!contentIsFree}
|
|
disabled={disabled}
|
|
onChange={() => updatePublishForm({ contentIsFree: false })}
|
|
/>
|
|
{!contentIsFree && (
|
|
<FormFieldPrice
|
|
name="content_cost_amount"
|
|
min={0}
|
|
price={fee}
|
|
onChange={(newFee) => updatePublishForm({ fee: newFee })}
|
|
/>
|
|
)}
|
|
{fee && fee.currency !== 'LBC' && (
|
|
<p className="form-field__help">
|
|
{__(
|
|
'All content fees are charged in LBRY Credits. For alternative payment methods, the number of LBRY Credits charged will be adjusted based on the value of LBRY Credits at the time of purchase.'
|
|
)}
|
|
</p>
|
|
)}
|
|
</React.Fragment>
|
|
}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default PublishPrice;
|