main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 5 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
903 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | import styles from "../EntranceModal/EntranceModal.module.css";
|
---|
| 2 | import React, { useRef } from "react";
|
---|
| 3 |
|
---|
| 4 | export default function ModalUploadRoomImage() {
|
---|
| 5 | const fileInputRef = useRef(null);
|
---|
| 6 |
|
---|
| 7 | const handleClick = () => {
|
---|
| 8 | fileInputRef.current.click();
|
---|
| 9 | };
|
---|
| 10 |
|
---|
| 11 | return (
|
---|
| 12 | <div className={styles.formGroup}>
|
---|
| 13 | <label htmlFor="name">Room Image</label>
|
---|
| 14 | <div className={styles.customFileInput}>
|
---|
| 15 | <button
|
---|
| 16 | type="button"
|
---|
| 17 | className={styles.uploadButton}
|
---|
| 18 | onClick={handleClick}
|
---|
| 19 | >
|
---|
| 20 | Upload Image
|
---|
| 21 | </button>
|
---|
| 22 | <input
|
---|
| 23 | type="file"
|
---|
| 24 | accept="image/*"
|
---|
| 25 | ref={fileInputRef}
|
---|
| 26 | style={{ display: "none" }}
|
---|
| 27 | />
|
---|
| 28 | </div>
|
---|
| 29 | </div>
|
---|
| 30 | );
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.