Skip to content

Instantly share code, notes, and snippets.

View popocreator's full-sized avatar
🎯
Focusing

Jisung Hong popocreator

🎯
Focusing
  • Routinery
  • Suwon, Korea
View GitHub Profile
// export default interface Entity {
// fid?: string; // firestoreId
// delYn?: string;
// ...
// }
import Entity from '@/models/Entity';
import {ReactNativeFirebase} from '@react-native-firebase/app';
import firestore, {
FirebaseFirestoreTypes,
@popocreator
popocreator / react-native-reanimated-drag-sort_apple-music.jsx
Created February 6, 2023 15:10 — forked from eveningkid/react-native-reanimated-drag-sort_apple-music.jsx
React Native Reanimated 2 Multiple Drag and Sort: Apple Music Example
// Expo SDK40
// expo-blur: ~8.2.2
// expo-haptics: ~8.4.0
// react-native-gesture-handler: ~1.8.0
// react-native-reanimated: ^2.0.0-rc.0
// react-native-safe-area-context: 3.1.9
import React, { useState } from 'react';
import {
Image,
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install nvm
mkdir ~/.nvm
git branch | egrep "fix|refactor|feat|issue" | xargs git branch -D
export default function useColor(theme: string) {
return (white, dark) => {
return theme !== 'dark' ? white : dark;
};
}
const theme = useTheme();
const color = useColor(theme);
// color: color('#fff', '#000')
import {useCallback, useState} from 'react';
export interface TabProps {
tab: string;
openTab: (name: string) => void;
}
export default function useTabProps(initialTab?: string): TabProps {
const [tab, setTab] = useState<string>(initialTab);
import {useCallback, useState} from 'react';
export interface ModalProps {
modal: string;
closeModal: () => void;
openModal: (name: string) => void;
}
export default function useModalProps(): ModalProps {
const [modal, setModal] = useState<string>(null);
import * as React from 'react';
import { TouchableOpacity, Text } from 'react-native';
import { useTheme } from '@react-navigation/native';
function MyButton() {
const { colors } = useTheme();
const styles = styleWithTheme(colors);
return (
<TouchableOpacity style={styles.card}>