Skip to content

Instantly share code, notes, and snippets.

View ivandotv's full-sized avatar
🏠
Working from home

Ivan Vlatković ivandotv

🏠
Working from home
View GitHub Profile
@ivandotv
ivandotv / sheet-popup-modal.tsx
Created October 17, 2023 13:54
Bottom sheet popup modal
export function Popup({
showPopup,
setShowPopup,
}: {
showPopup: boolean
setShowPopup: (b: boolean) => void
}) {
const bottomSheetRef = useRef<BottomSheet>(null)
const popupSnappoints = ["30%"]
@ivandotv
ivandotv / bottom-sheet-sample.js
Created October 17, 2023 13:52
Bottom sheet component sample
// create a reference to the bottom sheet
const bottomSheetRef = useRef<BottomSheet>(null)
//custom snap points
const snapPoints = ["30%", "60%"]
//track the current snap point index
const [currentIndex, setCurrentIndex] = useState(-1)
// track on which snap point index bottom sheet is currently
@ivandotv
ivandotv / BottomSheetComponent.tsx
Created October 17, 2023 13:34
Bottom sheet component
export function BottomSheetComponent({
showBottomSheet,
setShowBottomSheet,
}: {
showBottomSheet: boolean
setShowBottomSheet: (b: boolean) => void
}) {
// create a reference to the bottom sheet
const bottomSheetRef = useRef<BottomSheet>(null)
@ivandotv
ivandotv / babel-config.js
Created October 17, 2023 13:32
babel config react native reanimated
module.exports = function (api) {
api.cache(true)
return {
presets: ["babel-preset-expo"],
plugins: ["react-native-reanimated/plugin"],
}
}
@ivandotv
ivandotv / package-install.sh
Created October 17, 2023 13:29
Bottom sheet install package
yarn add @gorhom/bottom-sheet@^4
expo install react-native-reanimated react-native-gesture-handler
@ivandotv
ivandotv / expo-setup.sh
Created October 17, 2023 13:25
expo setup gist
npx create-expo-app -t expo-template-blank-typescript
@ivandotv
ivandotv / ci.yml
Created April 13, 2022 15:11
github actions docker pull image if not cached
name: Test
on:
push:
branches:
- '*'
pull_request:
branches:
- main
- develop
jobs:
@ivandotv
ivandotv / machine.js
Created July 17, 2021 13:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ivandotv
ivandotv / machine.js
Created September 16, 2020 18:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ivandotv
ivandotv / machine.js
Last active September 16, 2020 18:16
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions