Skip to content

Commit

Permalink
Fix modal styles and remove unused hooks (#7615)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers authored Feb 16, 2024
1 parent 25a83fd commit 8004f92
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 115 deletions.
2 changes: 1 addition & 1 deletion packages/harmony/src/components/modal/Modal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

:global(.bgModal) {
background-color: rgba(0, 0, 0, 0.6);
z-index: 9999;
z-index: calc(var(--harmony-layer-modal) - 1);
position: fixed;
opacity: 0;
top: 0;
Expand Down
6 changes: 2 additions & 4 deletions packages/harmony/src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import ReactDOM from 'react-dom'
import { animated, useTransition } from 'react-spring'
import { useEffectOnce } from 'react-use'

import { useClickOutside } from 'hooks/useClickOutside'

import { useHotkeys, useScrollLock } from '../../hooks'
import { useHotkeys, useScrollLock, useClickOutside } from '../../hooks'
import { IconClose } from '../../icons'

import styles from './Modal.module.css'
Expand Down Expand Up @@ -348,7 +346,7 @@ export const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(
className={styles.dismissButton}
onClick={onClose}
>
<IconClose />
<IconClose color='subdued' size='s' />
</div>
)}
<div
Expand Down
2 changes: 2 additions & 0 deletions packages/harmony/src/components/modal/ModalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const ModalHeader = forwardRef<HTMLDivElement, ModalHeaderProps>(
aria-label='dismiss dialog'
className={cn(styles.dismissButton, dismissButtonClassName)}
icon={IconClose}
color='subdued'
size='s'
onClick={handleClose}
/>
) : null}
Expand Down
1 change: 1 addition & 0 deletions packages/harmony/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './foundations/color/semantic.css'
import './foundations/motion/motion.css'
import './foundations/corner-radius/corner-radius.css'
import './foundations/shadows/shadows.css'
import './foundations/layers/layers.css'

export * from './foundations'
export * from './components'
Expand Down
52 changes: 0 additions & 52 deletions packages/stems/src/hooks/useClickOutside.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/stems/src/hooks/useHotKeys.ts

This file was deleted.

40 changes: 0 additions & 40 deletions packages/stems/src/hooks/useScrollLock.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/stems/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export {
TokenValueSliderProps
} from './components/TokenValueSlider'

export { useClickOutside } from './hooks/useClickOutside'
export { useScrollLock } from './hooks/useScrollLock'
export { useMediaQueryListener } from './hooks/useMediaQueryListener'

export {
MarkdownViewer,
MarkdownViewerProps
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/hooks/useScrollLock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useScrollLock as stemsScrollLock } from '@audius/stems'
import { useScrollLock as harmonyScrollLock } from '@audius/harmony'
import { useDispatch } from 'react-redux'

import {
Expand All @@ -17,7 +17,7 @@ const useScrollLock = (
const dispatch = useDispatch()
increment = increment ?? (() => dispatch(incrementScrollCount()))
decrement = decrement ?? (() => dispatch(decrementScrollCount()))
stemsScrollLock(lock, increment, decrement)
harmonyScrollLock(lock, increment, decrement)
}

export default useScrollLock

0 comments on commit 8004f92

Please sign in to comment.