v2.5.2
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
.button {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-weight: 600;
|
||||
padding: 5px 16px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
background-color: #f2f2f7;
|
||||
color: #2c2f3c;
|
||||
}
|
||||
:global(.wx-willow-dark-theme .button) {
|
||||
background-color: #384047;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import React, { useRef } from 'react';
|
||||
import './UbloadButton.css';
|
||||
|
||||
function UploadButton({ text, onChange }) {
|
||||
|
||||
const fileInput = useRef(null);
|
||||
|
||||
function handleClick() {
|
||||
fileInput.current?.click();
|
||||
}
|
||||
|
||||
function handleChange() {
|
||||
if (onChange) {
|
||||
onChange();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<button className="button" onClick={handleClick}>
|
||||
{text}
|
||||
</button>
|
||||
<input
|
||||
ref={fileInput}
|
||||
id="import-file"
|
||||
type="file"
|
||||
accept=".xml"
|
||||
onChange={handleChange}
|
||||
style={{ display: 'none' }}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default UploadButton;
|
||||
Reference in New Issue
Block a user