Skip to content

Instantly share code, notes, and snippets.

View Karthik-B-06's full-sized avatar
๐Ÿ™
trying to create and solve problems with code

Karthik Karthik-B-06

๐Ÿ™
trying to create and solve problems with code
View GitHub Profile
{/* Lighter Color Feedback */}
<View style={tailwind('mt-10')}>
<Pressable
style={({ pressed }) => [
tailwind('p-4 items-center border-gray-200 bg-white'),
separatorBorderWidth,
pressed ? tailwind('bg-gray-200') : {},
]}
>
<View>
<Pressable
style={({ pressed }) => [
tailwind('p-4 items-center bg-blue-600'),
pressed ? { opacity: 0.9 } : {},
]}
>
<View>
<Text style={[bodyTextStyle.FS18_MEDIUM, tailwind('text-white text-center')]}>
Pressable a simple opacity
</Text>
<TapGestureHandler
onHandlerStateChange={(event) => {
if (event.nativeEvent.state === State.BEGAN) {
spring(springValue, {
toValue: 1,
mass: 1,
damping: 20,
stiffness: 150,
overshootClamping: false,
restSpeedThreshold: 0.001,
<Animated.View
style={[
{
transform: [
{
scale: interpolate(springValue, {
inputRange: [0, 0.5],
outputRange: [1, 0.95],
}),
},
onHandlerStateChange={(event) => {
if (event.nativeEvent.state === State.BEGAN) {
spring(springValue, {
toValue: 1,
mass: 1,
damping: 20,
stiffness: 150,
overshootClamping: false,
restSpeedThreshold: 0.001,
restDisplacementThreshold: 0.001,
useEffect(() => {
// When notification is received in foreground
messaging().onMessage((remoteMessage) => {
Alert.alert('A new FCM message arrived!', JSON.stringify(remoteMessage));
});
// When an app is opened through notification
messaging().onNotificationOpenedApp((remoteMessage) => {
console.log('Notification caused app to open from background state:', remoteMessage.notification);
});
import messaging from '@react-native-firebase/messaging';
const getToken = async () => {
fcmToken = await messaging().getToken();
console.log(fcmToken);
};
useEffect(() => {
getToken();
}, [])
export default function AppNavigator(): JSX.Element {
const userState = useAuthStore((state) => state.userState);
// Zustand Toast Store
const [toastDetails, setShowToast] = useToastStore((state) => [state, state.setShowToast]);
// hooks for the bottom sheet
const bottomSheetRef = React.useRef<BottomSheet>(null);
const handleComponent: React.FC = () => <View />;
// variables for the bottom sheet
const snapPoints = React.useMemo(() => [0, '12%'], []);
React.useEffect(() => {
import create from 'zustand';
interface ToastType {
showToast: boolean;
toastMessage: string;
toastIcon: JSX.Element | React.FC | null;
}
interface ToastStore extends ToastType {
setShowToast: (values: ToastType) => void;
import isEqual from 'lodash/isEqual';
import PropTypes from 'prop-types';
import React, {useEffect, useRef, useState} from 'react';
import {Animated, StyleSheet, Text} from 'react-native';
import {TouchableHighlight} from 'react-native-gesture-handler';
import {COLORS, SANS_BASE} from '../helpers/styledTheme';
import TextInputWrapper from './TextInputWrapper';
const FormField = ({
handleChange,