Skip to content

Instantly share code, notes, and snippets.

View anatooly's full-sized avatar

Anatolii B anatooly

View GitHub Profile
@anatooly
anatooly / SafeAreaBackground.js
Created October 11, 2022 08:48
SafeAreaBackground.js
import React from 'react'
import {SafeAreaView} from 'react-native-safe-area-context'
const SafeAreaBackground = ({
children = null,
backgroundColorTop = '',
backgroundColorBottom = '',
}) => {
return (
<>
@anatooly
anatooly / ArbitrarySizeViewIos.js
Created October 11, 2022 08:49
ArbitrarySizeViewIos
import React from 'react'
import {View, Platform} from 'react-native'
const ARBITRARY_SIZE = 1000
const ArbitrarySizeViewIos = (props) => {
if (Platform.OS !== 'ios') return null
const backgroundColor = props?.backgroundColor
@anatooly
anatooly / PressableHighlight.js
Created October 17, 2022 07:53
PressableHighlight
export default function PressableHighlight(props) {
return (
<Pressable
android_ripple={{
color: '#676B5F',
}}
style={({ pressed }) => [
Platform.select({
ios: {
backgroundColor: pressed ? 'rgba(0,0,0,0.1)' : 'transparent',
@anatooly
anatooly / validate-branch-name
Created October 26, 2022 16:03
validate-branch-name
"postinstall": "husky install",
"validate-branch-name": {
"pattern": "^(feature|release|hotfix)/(KB-[0-9]+)-([a-zA-Z]+)",
"errorMsg": "Invalid branch name, please use name rule like this: feature/KB-123-implementNewLogic"
}
husky
husky-check-email
<Switch
style={{ transform: [{ scaleX: 0.9 }, { scaleY: 0.9 }] }}
onValueChange={handleValueChange}
value={value}
ios_backgroundColor={value ? '#B3BCB4' : '#B6B6B6'}
trackColor={{
false: '#B6B6B6',
true: '#B3BCB4',
}}
thumbColor={value ? palette.green : palette.gray}