Skip to content

Instantly share code, notes, and snippets.

@lintonye
Created November 21, 2019 20:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lintonye/00f503a2f8ae5dc84655f3d02e81a9b2 to your computer and use it in GitHub Desktop.
import * as React from "react"
import { Override, Data, useAnimation } from "framer"
// Learn more: https://framer.com/docs/overrides/
const bottomSheetHeight = 129
const appState = Data({
bottomSheetY: bottomSheetHeight,
})
export function ChatHead(props): Override {
const anim = useAnimation()
return {
drag: true,
animate: anim,
onDragStart: () => {
appState.bottomSheetY = 0
},
onDragEnd: () => {
appState.bottomSheetY = bottomSheetHeight
anim.start({ x: 0 })
},
}
}
export function BottomSheet(props): Override {
return {
animate: { y: appState.bottomSheetY },
transition: { duration: 0.2 },
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment