Skip to content

Instantly share code, notes, and snippets.

@damikdk
damikdk / Marquee.tsx
Created June 10, 2024 13:57
Modern reanimated react-native horizontal marquee marquee
import { StyleSheet, View } from "react-native";
import React, { useEffect, useState } from "react";
import Animated, {
useAnimatedRef,
useAnimatedStyle,
useSharedValue,
withRepeat,
withTiming,
} from "react-native-reanimated";
у нас:
<View style={ДЕНЬ}>
<TouchableOpacity БЕЗ СТИЛЯ>
<View style={ЧИСЛО}/>
<View style={ИНДИКАТОР}/>
</TouchableOpacity>
</View>
в библиотечке:
<TouchableOpacity без стиля>
@damikdk
damikdk / schedule.txt
Last active September 26, 2017 16:22
schedule api
для мобилок:
{
'22.09.2017': [
{ hour: 8, price: 200 },
{ hour: 9, price: 300 },
{ hour: 10, price: 400 },
...
{ hour: 23, price: 500 }
],
@damikdk
damikdk / hideOnScroll.js
Last active December 4, 2020 07:14 — forked from mmazzarolo/hideOnScroll.js
react-native-action-button hide/show view on scroll down/scroll up
// 1. Define a state variable for showing/hiding the action-button
state = {
shouldShow: false,
}
// 2. Define a variable that will keep track of the current scroll position
_scrollOffset = 0
// 3. Add an onScroll listener to your listview/scrollview
<ScrollView