Added data download ability
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { createBoard } from '@wixc3/react-board';
|
||||
import { LoadingButton } from '../../../components/loading-button/loading-button';
|
||||
|
||||
|
||||
import React, { useState } from "react";
|
||||
import logo from "./logo.svg";
|
||||
|
||||
|
||||
const LoadingButtonWrapper: React.FC<{}> = props => {
|
||||
|
||||
const [progress, setProgress] = useState(0);
|
||||
|
||||
const onClick = () => {
|
||||
const interval = setInterval(() => {
|
||||
setProgress((prevProgress) => {
|
||||
if (prevProgress >= 100) {
|
||||
clearInterval(interval);
|
||||
return 0;
|
||||
}
|
||||
console.log(prevProgress);
|
||||
return prevProgress + 15;
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
return (
|
||||
<LoadingButton onClick={onClick} progress={progress} />
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default createBoard({
|
||||
name: 'LoadingButton',
|
||||
Board: () => <LoadingButtonWrapper />
|
||||
});
|
||||
Reference in New Issue
Block a user