Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Use stems modal in SourceFilesModal (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
piazzatron authored Oct 30, 2020
1 parent 8317c90 commit 079c0be
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"private": true,
"dependencies": {
"@audius/libs": "^1.0.9",
"@audius/stems": "0.2.11",
"@audius/stems": "0.2.12",
"@optimizely/optimizely-sdk": "^4.0.0",
"@reduxjs/toolkit": "^1.3.2",
"@sentry/browser": "^5.10.2",
Expand Down
29 changes: 25 additions & 4 deletions src/components/source-files-modal/SourceFilesModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import React, { useCallback } from 'react'
import AudiusModal from 'components/general/AudiusModal'
import { Button, ButtonSize, ButtonType, IconRemove } from '@audius/stems'
import {
Button,
ButtonSize,
ButtonType,
IconRemove,
Modal
} from '@audius/stems'

import styles from './SourceFilesModal.module.css'
import Dropzone from 'components/upload/Dropzone'
Expand All @@ -11,6 +16,11 @@ import IconButton from 'components/general/IconButton'
import LoadingSpinner from 'components/loading-spinner/LoadingSpinner'
import Switch from 'components/general/Switch'
import cn from 'classnames'
import {
incrementScrollCount,
decrementScrollCount
} from 'store/application/ui/scrollLock/actions'
import { useDispatch } from 'react-redux'

const MAX_ROWS = 5

Expand Down Expand Up @@ -263,8 +273,16 @@ const SourceFilesModal = ({
onSelectCategory,
onDeleteStem
}: SourceFilesModalProps) => {
const dispatch = useDispatch()
const incrementScroll = useCallback(() => dispatch(incrementScrollCount()), [
dispatch
])
const decrementScroll = useCallback(() => dispatch(decrementScrollCount()), [
dispatch
])

return (
<AudiusModal
<Modal
isOpen={isOpen}
onClose={onClose}
showTitleHeader
Expand All @@ -276,6 +294,9 @@ const SourceFilesModal = ({
headerContainerClassName={styles.modalHeader}
titleClassName={styles.modalTitle}
subtitleClassName={styles.modalSubtitle}
zIndex={12000}
incrementScrollCount={incrementScroll}
decrementScrollCount={decrementScroll}
>
<SourceFilesView
downloadSettings={downloadSettings}
Expand All @@ -292,7 +313,7 @@ const SourceFilesModal = ({
type={ButtonType.SECONDARY}
onClick={onClose}
/>
</AudiusModal>
</Modal>
)
}

Expand Down

0 comments on commit 079c0be

Please sign in to comment.