Skip to content

Commit

Permalink
[PAY-1083] - Only allow prompt modal when single track is being uploa…
Browse files Browse the repository at this point in the history
…ded (#3115)

Co-authored-by: Saliou Diallo <saliou@audius.co>
  • Loading branch information
sddioulde and Saliou Diallo authored Mar 28, 2023
1 parent 36909d1 commit 4233ee6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/web/src/components/data-entry/FormTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,12 @@ const AdvancedForm = (props) => {
Render the gated content upload prompt component which is responsible
for whether or its content will modal will be displayed.
*/}
{props.type === 'track' && props.isUpload ? (
{props.allowPromptModal ? (
<GatedContentUploadPromptModal
onSubmit={() => setIsAvailabilityModalOpen(true)}
onSubmit={() => {
props.toggleAdvanced()
setIsAvailabilityModalOpen(true)
}}
/>
) : null}
{showAvailability && (
Expand Down Expand Up @@ -843,6 +846,7 @@ class FormTile extends Component {
/>
<AdvancedForm
{...this.props}
toggleAdvanced={this.toggleAdvanced}
advancedShow={advancedShow}
advancedVisible={advancedVisible}
licenseType={licenseType}
Expand Down Expand Up @@ -916,6 +920,9 @@ FormTile.propTypes = {
/** Whether we are in the track upload flow */
isUpload: PropTypes.bool,

/** Whether we allow showing the gated track upload prompt modal */
allowPromptModal: PropTypes.bool,

/** Initial form for in case we are in the edit track modal */
initialForm: PropTypes.object,

Expand Down Expand Up @@ -962,6 +969,7 @@ FormTile.defaultProps = {
onChangeOrder: () => {},
onChangeField: () => {},
isUpload: true,
allowPromptModal: false,
initialForm: {},
showUnlistedToggle: true,
showHideTrackSectionInModal: true,
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/pages/upload-page/components/EditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class EditPage extends Component {
requiredFields={requiredTracksFields[i]}
playing={i === previewIndex}
type={'track'}
allowPromptModal={tracks.length === 1}
onAddStems={(stems) => this.props.onAddStems(stems, i)}
onSelectStemCategory={(category, stemIndex) =>
this.props.onSelectStemCategory(category, i, stemIndex)
Expand Down

0 comments on commit 4233ee6

Please sign in to comment.