I am trying to create a push notification in framer x (react based).
It should work something like this:
customer opens mockup > timer in background starts > timer reaches five and fires event > event triggers push frame > push frame is visible on screen.
I've been playing around for a while now and I just can't figure it out...
in my last attempt I tried to solve it by changing the opacity, but I still can't update the return statement...
import * as React from "react"
import { Frame } from "framer"
export function DraggingA() {
let counter = 0
const style = {
opacity: 0,
}
const modalComponentNew = (
<Frame
drag={true}
dragConstraints={{ top: 0, right: 0, bottom: 0, left: 0 }}
dragElastic={1}
size={150}
radius={25}
background={"#06F"}
center={true}
opacity={style.opacity}
/>
)
let x = setInterval(function() {
if (counter < 5) {
counter++
console.log(counter)
}
if (counter >= 5) {
clearInterval(x)
style.opacity = 1
console.log("counter stops")
return modalComponentNew
}
}, 1000)
return modalComponentNew
}