mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
NodeImageBlock resizes to content
This commit is contained in:
parent
a0272f5baa
commit
1299a0e766
5 changed files with 79 additions and 14 deletions
|
@ -7,13 +7,18 @@ import classNames = require('classnames');
|
|||
interface IProps {
|
||||
total: number;
|
||||
current: number;
|
||||
onChange: (current: number) => void;
|
||||
}
|
||||
|
||||
const ImageSwitcher: FC<IProps> = ({ total, current }) => (
|
||||
const ImageSwitcher: FC<IProps> = ({ total, current, onChange }) => (
|
||||
<div className={styles.wrap}>
|
||||
<div className={styles.switcher}>
|
||||
{range(0, total).map(item => (
|
||||
<div className={classNames({ is_active: item === current })} key={item} />
|
||||
<div
|
||||
className={classNames({ is_active: item === current })}
|
||||
key={item}
|
||||
onClick={() => onChange(item)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
width: 100%;
|
||||
height: 0;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.switcher {
|
||||
|
@ -22,7 +23,7 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: .5;
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.25s;
|
||||
|
||||
&:hover {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue