-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/oraidex/oraiswap-frontend i…
…nto feat/connect-tron-owallet
- Loading branch information
Showing
280 changed files
with
6,145 additions
and
7,866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.form-file-upload { | ||
height: 16rem; | ||
width: 28rem; | ||
max-width: 100%; | ||
text-align: center; | ||
position: relative; | ||
|
||
.input-file-upload { | ||
display: none; | ||
} | ||
|
||
.label-file-upload { | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-width: 2px; | ||
border-radius: 1rem; | ||
border-style: dashed; | ||
border-color: #cbd5e1; | ||
background-color: #f8fafc; | ||
|
||
.upload-button { | ||
cursor: pointer; | ||
padding: 0.25rem; | ||
font-size: 1rem; | ||
border: none; | ||
font-family: 'Oswald', sans-serif; | ||
background-color: transparent; | ||
|
||
&:hover { | ||
text-decoration-line: underline; | ||
} | ||
} | ||
|
||
.drag-active { | ||
background-color: #ffffff; | ||
} | ||
} | ||
|
||
.drag-file-element { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
border-radius: 1rem; | ||
top: 0px; | ||
right: 0px; | ||
bottom: 0px; | ||
left: 0px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from "react"; | ||
import styles from "./index.module.scss"; | ||
import cn from 'classnames/bind'; | ||
|
||
const cx = cn.bind(styles); | ||
|
||
const ImageInput = ({ }) => { | ||
const [dragActive, setDragActive] = React.useState(false); | ||
const [imageUrl, setImageUrl] = React.useState(''); | ||
const inputRef = React.useRef(null); | ||
|
||
const handleDrag = function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
if (e.type === "dragenter" || e.type === "dragover") { | ||
setDragActive(true); | ||
} else if (e.type === "dragleave") { | ||
setDragActive(false); | ||
} | ||
}; | ||
|
||
const handleDrop = function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
setDragActive(false); | ||
if (e.dataTransfer.files && e.dataTransfer.files[0]) { | ||
// handleFiles(e.dataTransfer.files); | ||
|
||
} | ||
}; | ||
|
||
const handleChange = function (e) { | ||
console.log("change", e.target.files) | ||
e.preventDefault(); | ||
|
||
if (e.target.files && e.target.files[0]) { | ||
// handleFiles(e.target.files); | ||
console.log(e.target.files[0]); | ||
setImageUrl(URL.createObjectURL(e.target.files[0])); | ||
} | ||
}; | ||
|
||
const onButtonClick = () => { | ||
inputRef.current.click(); | ||
}; | ||
|
||
return ( | ||
<form className="form-file-upload" onDragEnter={handleDrag} onSubmit={(e) => e.preventDefault()}> | ||
<input ref={inputRef} type="file" className="input-file-upload" multiple={true} onChange={handleChange} /> | ||
<label className={cx("label-file-upload", dragActive ? "drag-active" : "")} htmlFor="input-file-upload"> | ||
<div> | ||
{/* <p>Drag and drop your file here or</p> | ||
<button className="upload-button" onClick={onButtonClick}>Upload a file</button> */} | ||
</div> | ||
<div> | ||
<img src={imageUrl} alt="preview picture" width={150} height={150} /> | ||
</div> | ||
</label> | ||
{dragActive && <div className="drag-file-element" onDragEnter={handleDrag} onDragLeave={handleDrag} onDragOver={handleDrag} onDrop={handleDrop}></div>} | ||
</form> | ||
); | ||
} | ||
|
||
export default ImageInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.