Skip to content

Instantly share code, notes, and snippets.

View Falconiere's full-sized avatar
🏠
Working from home

Falconiere R. Barbosa Falconiere

🏠
Working from home
View GitHub Profile
@Falconiere
Falconiere / SimpleComponent.js
Last active November 3, 2019 01:14
A simple component before hooks
import React, { PureComponent, Fragment } from 'react'
export default class SimpleComponent extends PureComponent {
constructor(props){
super(props)
this.state = { counter: 0 }
}
handleOnClick = e => {
@Falconiere
Falconiere / SimpleComponent.js
Last active November 3, 2019 01:21
A simple component after hooks
import React, { Fragment, useState } from 'react'
export default function SimpleComponent(){
const [counter, setCounter] = useState(0)
function handleOnClick(e){
e.preventDefault()
setCounter(counter + 1)
}
@Falconiere
Falconiere / SimpleComponent.js
Created November 3, 2019 01:26
A simple example with styled component
import React, { useState } from 'react'
import styled from 'styled-components'
// define styled component container
const SimpleComponentContainer = styled.div`
background-color: ${({ counter }) => counter > 10 ? 'red' : '#ddd' };
`
export default function SimpleComponent(){
@Falconiere
Falconiere / .eslintrc.js
Created March 7, 2020 20:28
My eslint configuration for react-native app
module.exports = {
root: true,
extends:[
'@react-native-community',
"plugin:import/errors",
"plugin:import/warnings"
],
"settings": {
"import/resolver": {
"babel-module": {}
@Falconiere
Falconiere / babel.config.js
Created March 7, 2020 20:53
This is my config babel for react-native app (I'm using it in my spotify clone)
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
root: ['./src'],
alias: {
components: './src/components',
assets: './src/assets',
@Falconiere
Falconiere / jsconfig.json
Created March 8, 2020 01:10
My jsconfig.json for build the paths of aliases in react-native
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": ["src/*"]
}
}
}
@Falconiere
Falconiere / .prettierrc.js
Created March 8, 2020 04:00
My prettier for react-native app
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: false,
singleQuote: true,
trailingComma: 'none',
semi: false,
commaDangle: false
};
@Falconiere
Falconiere / App.js
Last active March 8, 2020 18:41
This my hello world with material bottom in ReactNative
// libraries
import React from 'react'
import { View, Text } from 'react-native'
import { NavigationContainer } from '@react-navigation/native'
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'
import Icon from 'react-native-vector-icons/FontAwesome5'
const Container = ({ children }) => (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
@Falconiere
Falconiere / Info.plist
Last active March 14, 2020 02:52
This is the plist that I use to import the fonts for ios from react-native-vector-icons
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
@Falconiere
Falconiere / theme.js
Created April 4, 2020 01:25
Generice theme file for react apps
const main = {
colors: {
primary: '#222327',
light: '#bdbbbc',
gray: '#898a8f',
white: '#ffffff',
black: '#121212',
green: '#1db954',
transparent: 'transparent'
},