Run:
npm i react-navigation-shared-element@next react-native-shared-element
npm i @react-navigation/native@^5.0.9 @react-navigation/stack@^5.1.1
import { Module } from '@nestjs/common' | |
import { AuthService } from './auth.service' | |
@Module({ | |
providers: [AuthService], | |
exports: [AuthService], | |
}) | |
export class AuthModule {} |
function useCachedAbortiveQuery<T>( | |
query: DocumentNode, | |
variables: Record<string, unknown>, | |
deps: Array<any> | |
) { | |
const apolloClient = useApolloClient(); | |
const [data, setData] = useState<T>(); | |
const [error, setError] = useState<Error | null>(null); | |
const [loading, setLoading] = useState<boolean>(true); |
-- how to model threaded comments (e.g. reddit comments) in SQL with a simple 'ancestors' column | |
-- The comment tree: | |
-- [1] | |
-- / \ | |
-- [2] [4] | |
-- / \ \ | |
-- [3] [7] [6] | |
-- / | |
-- [5] |
import React, { | |
useCallback, | |
useEffect, | |
useState, | |
FunctionComponent, | |
ComponentClass, | |
useMemo, | |
useRef, | |
Key | |
} from 'react'; |
render (): React$Element<Object> { | |
let {user, kid, goal, balance} = this.props | |
let currentLevel = this.getCurrentLevel() | |
if (!goal) return this.renderEmptyState() | |
let pipes = this.getPipes(goal, kid, user, currentLevel, this.getLevelToClimbTo()) | |
return <View style={{flex: 1}}> | |
<ColorFix color={colors.stratos} /> | |
<ColorFix isBottom color={colors.fiftyShades} /> | |
<Animated.ScrollView ref={this.setScrollRef} onScroll={this.onScroll} scrollEventThrottle={16} contentContainerStyle={styles.scrollContainer} style={styles.container}> | |
<LinearGradient style={styles.backgroundImageView} colors={[colors.stratos, colors.stratos, colors.kingfisherDaisy]}> |
import React, { useState, useRef, useContext, useCallback } from 'react'; | |
import { Dimensions, View, Animated } from 'react-native'; | |
import { TabView } from 'react-native-tab-view'; | |
import { TabScreen } from './Tab'; | |
import { CustomTabBar } from './TabBar'; | |
import { ThemeContext } from 'react-native-elements'; | |
import { useHeaderHeight } from '@react-navigation/stack'; | |
const AnimatedHeader = ({ style, content }) => { | |
return <Animated.View style={style}>{content}</Animated.View>; | |
}; |
/** UI element heights which used in message height calculation */ | |
textPaddingVertical: number = 7; | |
textPaddingHorizontal: number = 10; | |
timeHeight: number = 12; | |
timeTopMargin: number = 5; | |
messageContainerVerticalMargin: number = 7; | |
dateSeperatorVerticalMargin: number = 20; | |
dateSeperatorHeight: number = 15; | |
imageHeight: number = 170; | |
imageBottomMargin: number = 10; |
const LastSongs = (props) => { | |
const [songs, setSongs] = React.useState([]); | |
const [loading, setLoading] = React.useState(false); | |
const [page, setPage] = React.useState(1); | |
const [last_page, setLast_page] = React.useState(1); | |
const {saveSongs, isPlaying, isPauseTrigger} = props; | |
const _renderItems = useCallback( |
{ | |
"name": "Timpler", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"a": "cd ./android && ./gradlew app:assembleDebug && ./gradlew installDebug", | |
"android": "react-native run-android", | |
"ios": "react-native run-ios", | |
"start": "react-native start", | |
"test": "jest", |