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:
parent
f445882a61
commit
63a616875c
3 changed files with 16 additions and 15 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue