View typescript_example.tsx
type Message = { | |
id: number; | |
body: string; | |
} | |
type State = { | |
messages: Message[] | |
} | |
const messages: Message[] = [ |
View rentalPlacesData.json
[ | |
{ | |
"id": "08fa1f2d-5fea-4da1-b2bc-edf1b69b3e6e", | |
"type": "house", | |
"price": "$1936", | |
"size": 101, | |
"rating": 4, | |
"location": "Vista Hermosa", | |
"image": "https://images.unsplash.com/photo-1525896544042-354764aa27e6?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=bb22e6f49db10bc0c0c8efda661a1349&auto=format&fit=crop&w=668&q=80" | |
}, |
View .flow_config
[ignore] | |
; We fork some components by platform | |
./[.]android.js | |
; Ignore templates for 'react-native init' | |
<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.* | |
; Ignore RN jest | |
<PROJECT_ROOT>/node_modules/react-native/jest/.* |
View index.js
import { AppRegistry } from 'react-native'; | |
import { app } from './src/App'; | |
/* | |
if the "in-source" option is false (the defualt), you will import app this way: | |
import { app } from "./lib/js/src/App.js"; | |
*/ | |
AppRegistry.registerComponent('MyReasonApp', () => app); |
View App.re
open BsReactNative; | |
/* here we define some styles */ | |
module Styles = { | |
open Style; | |
let container = | |
style([ | |
flex(1.), | |
justifyContent(Center), |
View grid.css
.grid { | |
display: grid; | |
height: 100%; | |
grid-template-columns: 2rem repeat(2, auto) 2rem; | |
grid-template-rows: 4rem 4rem auto; | |
background-color: #fff; | |
} | |
.layer1 { | |
background-color: rgb(64, 213, 187); |
View withGA.js
import React from 'react'; | |
import GoogleAnalytics from 'react-ga'; | |
if (process.env.REACT_APP_ENVIRONMENT === 'production') { | |
GoogleAnalytics.initialize('UA-91111111-1'); | |
} | |
const withGA = WrappedComponent => { | |
const trackPage = page => { | |
GoogleAnalytics.set({ page }); |
View dropdownOptions.js
/* @flow */ | |
type UserTitleOptionT = 'Miss' | 'Mrs' | 'Mr' | 'Ms' | 'Dr'; | |
export const USER_TITLE_OPTIONS: Array<{ | |
id: UserTitleOptionT, | |
value: UserTitleOptionT | |
}> = [ | |
{ id: 'Miss', value: 'Miss' }, | |
{ id: 'Mrs', value: 'Mrs' }, | |
{ id: 'Mr', value: 'Mr' }, |
View circle.yml
machine: | |
environment: | |
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" | |
node: | |
version: 7.10.0 | |
dependencies: | |
override: | |
- yarn | |
cache_directories: |
View circle.yml
deployment: | |
development: | |
branch: master | |
commands: | |
- URL=$(now -t ${NOW_TOKEN}) | |
- now -t ${NOW_TOKEN} alias set ${URL} eedi-dev.now.sh | |
production: | |
branch: production | |
commands: | |
- URL=$(now -t ${NOW_TOKEN}) |
NewerOlder