1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Update multiline destructuring format based on style guide

This commit is contained in:
Brett Sun 2016-01-18 14:46:39 +01:00
parent 821fe79461
commit e5cae3fc34
20 changed files with 148 additions and 173 deletions

View File

@ -45,8 +45,7 @@ let AccordionListItemPiece = React.createClass({
}, },
render() { render() {
const { const { artistName,
artistName,
badge, badge,
buttons, buttons,
children, children,

View File

@ -44,8 +44,7 @@ export default function ({ action, displayName, title, tooltip }) {
}, },
render() { render() {
const { const { availableAcls,
availableAcls,
buttonAcceptClassName, buttonAcceptClassName,
currentUser, currentUser,
email, email,

View File

@ -32,8 +32,7 @@ const DetailProperty = React.createClass({
}, },
render() { render() {
const { const { children,
children,
className, className,
ellipsis, ellipsis,
label, label,

View File

@ -51,8 +51,7 @@ let Edition = React.createClass({
}, },
render() { render() {
const { const { actionPanelButtonListType,
actionPanelButtonListType,
coaError, coaError,
currentUser, currentUser,
edition, edition,

View File

@ -95,10 +95,9 @@ let EditionActionPanel = React.createClass({
}, },
render() { render() {
const { const { actionPanelButtonListType: ActionPanelButtonListType,
actionPanelButtonListType: ActionPanelButtonListType, currentUser,
edition, edition } = this.props;
currentUser } = this.props;
if (edition && if (edition &&
edition.notifications && edition.notifications &&

View File

@ -53,8 +53,7 @@ let AclFormFactory = React.createClass({
}, },
render() { render() {
const { const { action,
action,
autoFocusProperty, autoFocusProperty,
pieceOrEditions, pieceOrEditions,
currentUser, currentUser,

View File

@ -62,8 +62,7 @@ let ConsignForm = React.createClass({
render() { render() {
const { email } = this.state; const { email } = this.state;
const { const { autoFocusProperty,
autoFocusProperty,
createPublicContractAgreement, createPublicContractAgreement,
email: defaultEmail, email: defaultEmail,
handleSuccess, handleSuccess,

View File

@ -118,8 +118,7 @@ let LoanForm = React.createClass({
render() { render() {
const { email } = this.state; const { email } = this.state;
const { const { children,
children,
createPublicContractAgreement, createPublicContractAgreement,
email: defaultEmail, email: defaultEmail,
handleSuccess, handleSuccess,

View File

@ -143,16 +143,14 @@ const InputContractAgreementCheckbox = React.createClass({
getContractCheckbox() { getContractCheckbox() {
const contractAgreement = this.getContractAgreement(); const contractAgreement = this.getContractAgreement();
if(contractAgreement) { if (contractAgreement) {
const { const { contract: {
datetime_accepted: datetimeAccepted,
contract: {
issuer: contractIssuer, issuer: contractIssuer,
blob: { url_safe: contractUrl } blob: { url_safe: contractUrl }
} },
} = contractAgreement; datetime_accepted: datetimeAccepted } = contractAgreement;
if(datetimeAccepted) { if (datetimeAccepted) {
return ( return (
<div <div
className="notification-contract-pdf" className="notification-contract-pdf"
@ -168,10 +166,7 @@ const InputContractAgreementCheckbox = React.createClass({
</div> </div>
); );
} else { } else {
const { const { disabled, name, style } = this.props;
name,
disabled,
style } = this.props;
return ( return (
<InputCheckbox <InputCheckbox

View File

@ -77,11 +77,11 @@ const InputFineUploader = React.createClass({
value: file.key value: file.key
}); });
if(this.state.value && typeof this.props.onChange === 'function') { if (this.state.value && typeof this.props.onChange === 'function') {
this.props.onChange({ target: { value: this.state.value } }); this.props.onChange({ target: { value: this.state.value } });
} }
if(typeof this.props.submitFile === 'function') { if (typeof this.props.submitFile === 'function') {
this.props.submitFile(file); this.props.submitFile(file);
} }
}, },
@ -98,8 +98,7 @@ const InputFineUploader = React.createClass({
}, },
render() { render() {
const { const { areAssetsDownloadable,
areAssetsDownloadable,
enableLocalHashing, enableLocalHashing,
createBlobRoutine, createBlobRoutine,
disabled, disabled,
@ -117,7 +116,7 @@ const InputFineUploader = React.createClass({
// if disabled is actually set by property, we want to override // if disabled is actually set by property, we want to override
// isFineUploaderActive // isFineUploaderActive
if(typeof disabled !== 'undefined') { if (typeof disabled !== 'undefined') {
editable = !disabled; editable = !disabled;
} }

View File

@ -127,19 +127,18 @@ let FileDragAndDrop = React.createClass({
}, },
render: function () { render: function () {
const { const { allowedExtensions,
filesToUpload,
dropzoneInactive,
className,
hashingProgress,
handleCancelHashing,
multiple,
enableLocalHashing,
uploadMethod,
fileClassToUpload,
areAssetsDownloadable, areAssetsDownloadable,
areAssetsEditable, areAssetsEditable,
allowedExtensions } = this.props; className,
dropzoneInactive,
enableLocalHashing,
fileClassToUpload,
filesToUpload,
handleCancelHashing,
hashingProgress,
multiple,
uploadMethod } = this.props;
// has files only is true if there are files that do not have the status deleted or canceled // has files only is true if there are files that do not have the status deleted or canceled
let hasFiles = filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.size !== -1).length > 0; let hasFiles = filesToUpload.filter((file) => file.status !== 'deleted' && file.status !== 'canceled' && file.size !== -1).length > 0;

View File

@ -35,13 +35,12 @@ let FileDragAndDropDialog = React.createClass({
}, },
render() { render() {
const { const { enableLocalHashing,
fileClassToUpload,
hasFiles, hasFiles,
multipleFiles, multipleFiles,
enableLocalHashing, onClick,
uploadMethod, uploadMethod } = this.props;
fileClassToUpload,
onClick } = this.props;
if (hasFiles) { if (hasFiles) {
return null; return null;

View File

@ -145,9 +145,7 @@ export default function UploadButton({ className = 'btn btn-default btn-sm' } =
}, },
render() { render() {
const { const { allowedExtensions, multiple } = this.props;
multiple,
allowedExtensions } = this.props;
const { disabled } = this.state; const { disabled } = this.state;

View File

@ -53,11 +53,10 @@ let GlobalNotification = React.createClass({
}, },
renderNotification() { renderNotification() {
const { const { containerWidth,
notificationQueue: [notification],
notificationStatus,
notificationsPaused, notificationsPaused,
containerWidth } = this.state; notificationQueue: [notification],
notificationStatus } = this.state;
const notificationClasses = []; const notificationClasses = [];

View File

@ -259,8 +259,7 @@ let PieceList = React.createClass({
}, },
render() { render() {
const { const { accordionListItemType: AccordionListItemType,
accordionListItemType: AccordionListItemType,
bulkModalButtonListType: BulkModalButtonListType, bulkModalButtonListType: BulkModalButtonListType,
customSubmitButton, customSubmitButton,
customThumbnailPlaceholder, customThumbnailPlaceholder,

View File

@ -33,8 +33,7 @@ let WalletPieceContainer = React.createClass({
}, },
render() { render() {
const { const { children,
children,
currentUser, currentUser,
handleDeleteSuccess, handleDeleteSuccess,
loadPiece, loadPiece,

View File

@ -53,8 +53,7 @@ let MarketSubmitButton = React.createClass({
canEditionBeSubmitted(edition) { canEditionBeSubmitted(edition) {
if (edition && edition.extra_data && edition.other_data) { if (edition && edition.extra_data && edition.other_data) {
const { const { extra_data: {
extra_data: {
artist_bio: artistBio, artist_bio: artistBio,
display_instructions: displayInstructions, display_instructions: displayInstructions,
technology_details: technologyDetails, technology_details: technologyDetails,

View File

@ -107,8 +107,7 @@ let MarketAdditionalDataForm = React.createClass({
}, },
render() { render() {
const { const { editable,
editable,
extraData = {}, extraData = {},
isInline, isInline,
handleSuccess, handleSuccess,

View File

@ -51,8 +51,7 @@ let MarketPieceList = React.createClass({
render() { render() {
const { customThumbnailPlaceholder, location } = this.props; const { customThumbnailPlaceholder, location } = this.props;
const { const { currentUser: { email: userEmail },
currentUser: { email: userEmail },
whitelabel: { whitelabel: {
name: whitelabelName = 'Market', name: whitelabelName = 'Market',
user: whitelabelAdminEmail user: whitelabelAdminEmail

View File

@ -112,8 +112,7 @@ let MarketRegisterPiece = React.createClass({
render() { render() {
const { location } = this.props; const { location } = this.props;
const { const { piece,
piece,
step, step,
whitelabel: { whitelabel: {
name: whitelabelName = 'Market' name: whitelabelName = 'Market'