Skip to content

Commit

Permalink
Fix style for narrow queue itme loader
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Oct 19, 2022
1 parent 764d641 commit b2a752d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/ui/lib/components/Loader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ import styles from './styles.scss';

type LoaderProps = {
type: 'default' | 'circle' | 'small';
className?: string;
}

const Loader: React.FC<LoaderProps> = ({
type='default'
type='default',
className
}) => {
return (
<span className={cx(
common.nuclear,
type,
styles.loader
styles.loader,
className
)}>
<span />
<span />
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/lib/components/QueueItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const QueueItem = ({
<div className={styles.thumbnail}>
{
isLoading
? <Loader type='small' />
? <Loader type='small' className={isCompact && styles.compact_loader} />
: <img src={_.defaultTo(track.thumbnail, artPlaceholder)} />
}

Expand Down
9 changes: 9 additions & 0 deletions packages/ui/lib/components/QueueItem/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@
height: 100%;
width: 100%;
}

.compact_loader {
width: 100%;
height: 100%;

span {
border-width: 4px;
}
}
}

.error_overlay {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/stories/components/queueItem.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ storiesOf('Components/Queue item', module)
.add('Compact', () => (
<div className='bg'>
<div
style={{ width: '4rem' }}
style={{ width: '2.5rem' }}
>
<QueueItem {...commonProps} isCompact />
<QueueItem {...commonProps}
Expand All @@ -87,7 +87,7 @@ storiesOf('Components/Queue item', module)
}}
/>
<div
style={{ width: '3rem' }}
style={{ width: '2.5rem' }}
>
<QueueItem {...commonProps}
isCompact
Expand Down

0 comments on commit b2a752d

Please sign in to comment.