1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 21:06:42 +07:00

player fixes

This commit is contained in:
Fedor Katurov 2019-10-13 19:15:21 +07:00
parent f445882a61
commit 63a616875c
3 changed files with 16 additions and 15 deletions

View file

@ -11,18 +11,22 @@ interface IProps {
onChange: (current: number) => void;
}
const ImageSwitcher: FC<IProps> = ({ total, current, onChange, loaded }) => (
<div className={styles.wrap}>
<div className={styles.switcher}>
{range(0, total).map(item => (
<div
className={classNames({ is_active: item === current, is_loaded: loaded[item] })}
key={item}
onClick={() => onChange(item)}
/>
))}
const ImageSwitcher: FC<IProps> = ({ total, current, onChange, loaded }) => {
if (total <= 1) return null;
return (
<div className={styles.wrap}>
<div className={styles.switcher}>
{range(0, total).map(item => (
<div
className={classNames({ is_active: item === current, is_loaded: loaded[item] })}
key={item}
onClick={() => onChange(item)}
/>
))}
</div>
</div>
</div>
);
);
};
export { ImageSwitcher };