npx mrm@2 lint-staged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import makeStyles from '@app/helpers/make-styles' | |
const useStyles = makeStyles(theme => ({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: theme.bg, | |
}, | |
text: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import {FlatList, useWindowDimensions, View} from 'react-native' | |
const GridList = ({numColumns, renderItem, spacing, ...props}) => { | |
const dimensions = useWindowDimensions() | |
return ( | |
<FlatList | |
numColumns={numColumns ?? 2} | |
renderItem={(...args) => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useCallback} from 'react' | |
const useFocus = refs => { | |
const focus = useCallback( | |
name => { | |
refs?.[name]?.current?.focus?.() | |
}, | |
[refs] | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// scripts/codegen/components.js | |
const fs = require('fs') | |
const path = require('path') | |
const header = '/**\n * This file is generated. Do not edit.\n */\n' | |
const code = fs | |
.readdirSync(path.join(__dirname, '..', '..', 'src', 'components')) | |
.filter(filename => !filename.endsWith('.js')) | |
.map(filename => `export {default as ${filename}} from './${filename}/${filename}'`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended", | |
"plugin:react/jsx-runtime", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:prettier/recommended" | |
], | |
"plugins": ["react", "@typescript-eslint", "prettier"], | |
"settings": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type GraphQLQuery = string | |
export type GraphQLMutation = string | |
export type Variables = { | |
[key: string]: any | |
} | |
type QueryBody = { | |
query: GraphQLQuery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createStore = reducer => { | |
let state | |
let listeners = [] | |
const getState = () => state | |
const dispatch = action => { | |
state = reducer(state, action) | |
listeners.forEach(listener => listener()) | |
} | |
const subscribe = listener => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DevSettings, Platform, ToastAndroid } from 'react-native' | |
import AsyncStorage from '@react-native-async-storage/async-storage' | |
import Snackbar from 'react-native-snackbar' | |
DevSettings.addMenuItem('Clear AsyncStorage', async () => { | |
const keys = await AsyncStorage.getAllKeys() | |
await AsyncStorage.multiRemove(keys.filter(key => !key.includes('@REACTOTRON'))) | |
const message = 'AsyncStorage has been cleared' | |
if (Platform.OS === 'android') { | |
ToastAndroid.show(message, ToastAndroid.SHORT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body::-webkit-scrollbar { | |
background-color: #fff; | |
width: 16px; | |
} | |
body::-webkit-scrollbar-track { | |
background-color: #fff; | |
} | |
body::-webkit-scrollbar-thumb { |