Created
March 29, 2021 15:30
-
-
Save KristofferTolboll2/c61c3f9e64c87e43d3f3629216df9037 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import _ as moment from 'moment'; | |
| export default function DailyReward(prosp) { | |
| const [isShowModal, setIsShowModal] = useState<boolean>(false); | |
| const [isRewardAvailible, setIsRewardAailible = useState<boolean>(false); | |
| const [timeLeft, setTimeLeft] = useState(0) //in miliseconds | |
| const [reward, setReward] = useState() | |
| useEffect(() =>{ | |
| //fetch data | |
| }, []) | |
| const submitRewardHandler = () =>{ | |
| axios.post(...).then(res =>{ | |
| setReward(res.data) | |
| } | |
| const parsedTime = moment(timeLeft).format('HH:mm*) | |
| return ( | |
| {timeleft && <div> {parsedTime} </div> } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment