Skip to content

Commit

Permalink
Fix clipping and scrolling of the source showcase sidebar (stream-lab…
Browse files Browse the repository at this point in the history
  • Loading branch information
gettinToasty authored Jul 13, 2022
1 parent f96b9f7 commit f14dbbd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
11 changes: 0 additions & 11 deletions app/components-react/windows/source-showcase/SourceShowcase.m.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,11 @@
width: 100%;
height: 100%;
padding: 24px;
padding-top: 64px;
background: var(--section);

.image-container {
min-height: 200px;
overflow: hidden;
position: relative;
}

img, video {
width: 100%;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}

Expand Down
39 changes: 20 additions & 19 deletions app/components-react/windows/source-showcase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { $t } from 'services/i18n';
import { useSourceShowcaseSettings } from './useSourceShowcase';
import styles from './SourceShowcase.m.less';
import SourceGrid from './SourceGrid';
import Scrollable from 'components-react/shared/Scrollable';

const { Content, Sider } = Layout;

Expand Down Expand Up @@ -95,26 +96,26 @@ function SideBar() {
collapsedWidth={0}
>
<div className={styles.preview}>
{displayData?.demoFilename && (
<div className={styles.imageContainer}>
{displayData?.demoVideo && (
<video autoPlay loop key={previewSrc}>
<source src={previewSrc} />
</video>
)}
{!displayData?.demoVideo && <img src={previewSrc} />}
</div>
)}
<h2>{displayData?.name}</h2>
<div>{displayData?.description}</div>
{displayData?.supportList?.length > 0 && (
<div className={styles.supportHeader}>{$t('Supports:')}</div>
)}
<ul style={{ fontSize: '13px' }}>
{displayData?.supportList?.map(support => (
<li key={support}>{support}</li>
{displayData?.demoFilename &&
(displayData?.demoVideo ? (
<video autoPlay loop key={previewSrc}>
<source src={previewSrc} />
</video>
) : (
<img src={previewSrc} />
))}
</ul>
<Scrollable style={{ height: '100%' }}>
<h2 style={{ marginTop: '24px' }}>{displayData?.name}</h2>
<div>{displayData?.description}</div>
{displayData?.supportList?.length > 0 && (
<div className={styles.supportHeader}>{$t('Supports:')}</div>
)}
<ul style={{ fontSize: '13px' }}>
{displayData?.supportList?.map(support => (
<li key={support}>{support}</li>
))}
</ul>
</Scrollable>
</div>
</Sider>
);
Expand Down

0 comments on commit f14dbbd

Please sign in to comment.