mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-01 15:46:40 +07:00
drop cell
This commit is contained in:
parent
5bf67309c3
commit
84f73c9cf3
4 changed files with 52 additions and 5 deletions
src/components/editors/ImageUploadButton
16
src/components/editors/ImageUploadButton/index.tsx
Normal file
16
src/components/editors/ImageUploadButton/index.tsx
Normal file
|
@ -0,0 +1,16 @@
|
|||
import React, { FC, ChangeEventHandler } from 'react';
|
||||
import * as styles from './styles.scss';
|
||||
|
||||
interface IProps {
|
||||
onUpload?: ChangeEventHandler<HTMLInputElement>;
|
||||
};
|
||||
|
||||
const ImageUploadButton: FC<IProps> = ({
|
||||
onUpload,
|
||||
}) => (
|
||||
<div className={styles.wrap}>
|
||||
<input type="file" onChange={onUpload} />
|
||||
</div>
|
||||
)
|
||||
|
||||
export { ImageUploadButton };
|
22
src/components/editors/ImageUploadButton/styles.scss
Normal file
22
src/components/editors/ImageUploadButton/styles.scss
Normal file
|
@ -0,0 +1,22 @@
|
|||
.wrap {
|
||||
padding-bottom: 100%;
|
||||
box-shadow: inset lighten($content_bg, 20%) 0 0 0 4px;
|
||||
position: relative;
|
||||
border-radius: $radius;
|
||||
cursor: pointer;
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.5s;
|
||||
|
||||
&:hover {}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue