Skip to content

Commit

Permalink
Enforce trailing comma, for a cleaner VSC diffing
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandomg committed Jul 10, 2019
1 parent 4ac8665 commit c09f7f9
Show file tree
Hide file tree
Showing 124 changed files with 777 additions and 776 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120
"printWidth": 120,
"trailingComma": "es5"
}
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ const theme = {
colors: {
...DefaultTheme.colors,
primary: '#00AFFF',
text: '#222222'
text: '#222222',
},
fonts: {
...DefaultTheme.fonts,
slab: 'RobotoSlab-Regular',
slabBold: 'RobotoSlab-Bold'
}
slabBold: 'RobotoSlab-Bold',
},
}
const App = () => {
// onRecaptcha = (token: string) => {
Expand Down Expand Up @@ -51,8 +51,8 @@ const styles = StyleSheet.create({
position: 'fixed',
maxWidth: '475px',
alignSelf: 'center',
backgroundColor: '#fff'
}
backgroundColor: '#fff',
},
})

let hotWrapper = () => () => App
Expand Down
4 changes: 2 additions & 2 deletions src/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const AppNavigator = createNavigator(
SwitchRouter(
{
BackupWallet,
AppNavigation
AppNavigation,
},
{
initialRouteName: 'AppNavigation'
initialRouteName: 'AppNavigation',
},
navigationConfig
),
Expand Down
4 changes: 2 additions & 2 deletions src/SignupRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import Auth from './components/auth/Auth'
const router = createSwitchNavigator(
{
Auth,
Signup
Signup,
},
{
initialRouteName: 'Auth'
initialRouteName: 'Auth',
}
)
let WebRouter
Expand Down
8 changes: 4 additions & 4 deletions src/components/appNavigation/AppNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ import { navigationOptions } from './navigationConfig'
*/
type AppNavigationProps = {
navigation: any,
store: Store
store: Store,
}

const routes = {
Dashboard: {
screen: Dashboard,
icon: homeIcon,
display: false
display: false,
},
Profile: {
screen: Profile,
display: false
}
display: false,
},
}

const initialRouteName = 'Dashboard'
Expand Down
6 changes: 3 additions & 3 deletions src/components/appNavigation/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { StyleSheet } from 'react-native'
*/
type NavBarProps = {
goBack?: () => void,
title: string
title: string,
}

/**
Expand All @@ -31,8 +31,8 @@ class NavBar extends React.Component<NavBarProps> {
const styles = StyleSheet.create({
titleStyle: {
textTransform: 'uppercase',
textAlign: 'center'
}
textAlign: 'center',
},
})

export default NavBar
2 changes: 1 addition & 1 deletion src/components/appNavigation/TabsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SimpleStore from '../../lib/undux/SimpleStore'

type TabViewProps = {
routes: { [string]: any },
goTo: (routeKey: string) => void
goTo: (routeKey: string) => void,
}

// TODO: Decide if makes sense keep this to add tab behavior again
Expand Down
6 changes: 3 additions & 3 deletions src/components/appNavigation/__tests__/TabsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import Profile from '../../profile/Profile'
describe('TabsView', () => {
const routes = {
Dashboard: {
screen: Dashboard
screen: Dashboard,
},
Profile: {
screen: Profile
}
screen: Profile,
},
}

it('renders without errors', () => {
Expand Down
38 changes: 19 additions & 19 deletions src/components/appNavigation/stackNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const DEFAULT_PARAMS = {
event: undefined,
receiveLink: undefined,
reason: undefined,
code: undefined
code: undefined,
}

const log = logger.child({ from: 'stackNavigation' })
Expand All @@ -25,12 +25,12 @@ type AppViewProps = {
navigation: any,
navigationConfig: any,
screenProps: any,
store: SimpleStore
store: SimpleStore,
}

type AppViewState = {
stack: Array<any>,
currentState: any
currentState: any,
}

/**
Expand All @@ -42,7 +42,7 @@ type AppViewState = {
class AppView extends Component<AppViewProps, AppViewState> {
state = {
stack: [],
currentState: {}
currentState: {},
}

/**
Expand Down Expand Up @@ -112,10 +112,10 @@ class AppView extends Component<AppViewProps, AppViewState> {
...state.stack,
{
route,
state: state.currentState
}
state: state.currentState,
},
],
currentState: { ...params, route }
currentState: { ...params, route },
}
},
state => {
Expand All @@ -133,13 +133,13 @@ class AppView extends Component<AppViewProps, AppViewState> {
this.trans = true
this.setState({
stack: [],
currentState: {}
currentState: {},
})

const route = navigation.state.routes[0]
route.params = {
...route.params,
...DEFAULT_PARAMS
...DEFAULT_PARAMS,
}

navigation.navigate(route)
Expand All @@ -153,7 +153,7 @@ class AppView extends Component<AppViewProps, AppViewState> {
this.props.navigation.navigate({
routeName,
params,
type: 'Navigation/NAVIGATE'
type: 'Navigation/NAVIGATE',
})
}

Expand Down Expand Up @@ -194,7 +194,7 @@ class AppView extends Component<AppViewProps, AppViewState> {
pop: this.pop,
screenState: this.state.currentState,
setScreenState: this.setScreenState,
toggleMenu: () => this.drawer.open()
toggleMenu: () => this.drawer.open(),
}
log.info('stackNavigation Render: FIXME rerender', descriptor, activeKey)
const Component = this.getComponent(descriptor.getComponent(), { screenProps })
Expand Down Expand Up @@ -224,13 +224,13 @@ class AppView extends Component<AppViewProps, AppViewState> {
*/
export const createStackNavigator = (routes: any, navigationConfig: any) => {
const defaultNavigationConfig = {
backRouteName: 'Home'
backRouteName: 'Home',
}

return createNavigator(SimpleStore.withStore(AppView), SwitchRouter(routes), {
...defaultNavigationConfig,
...navigationConfig,
navigationOptions
navigationOptions,
})
}

Expand All @@ -239,7 +239,7 @@ type PushButtonProps = {
routeName: Route,
params?: any,
screenProps: { push: (routeName: string, params: any) => void },
canContinue?: Function
canContinue?: Function,
}

/**
Expand Down Expand Up @@ -271,13 +271,13 @@ export const PushButton = ({ routeName, screenProps, canContinue, params, ...pro
PushButton.defaultProps = {
mode: 'contained',
dark: true,
canContinue: () => true
canContinue: () => true,
}

type BackButtonProps = {
...ButtonProps,
routeName?: Route,
screenProps: { goToParent: () => void }
screenProps: { goToParent: () => void },
}

/**
Expand Down Expand Up @@ -305,7 +305,7 @@ export const BackButton = (props: BackButtonProps) => {
type DoneButtonProps = {
...ButtonProps,
routeName?: Route,
screenProps: { goToRoot: () => void }
screenProps: { goToRoot: () => void },
}

/**
Expand All @@ -329,7 +329,7 @@ type NextButtonProps = {
screenProps: { push: (routeName: string, params: any) => void },
nextRoutes: [string],
label?: string,
canContinue?: Function
canContinue?: Function,
}

/**
Expand All @@ -344,7 +344,7 @@ export const NextButton = ({
screenProps,
nextRoutes: nextRoutesParam,
label,
canContinue
canContinue,
}: NextButtonProps) => {
const [next, ...nextRoutes] = nextRoutesParam ? nextRoutesParam : []
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/appSwitch/AppSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import zoomSdkLoader from '../dashboard/FaceRecognition/ZoomSdkLoader'

type LoadingProps = {
navigation: any,
descriptors: any
descriptors: any,
}

const log = logger.child({ from: 'AppSwitch' })
Expand Down
30 changes: 15 additions & 15 deletions src/components/auth/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Mnemonics from '../signin/Mnemonics'
type Props = {
navigation: any,
screenProps: {
push: Function
}
push: Function,
},
}

const log = logger.child({ from: 'Auth' })
Expand Down Expand Up @@ -79,7 +79,7 @@ class Auth extends React.Component<Props> {

Auth.navigationOptions = {
title: 'Auth',
navigationBarHidden: true
navigationBarHidden: true,
}

const styles = StyleSheet.create({
Expand All @@ -88,57 +88,57 @@ const styles = StyleSheet.create({
paddingLeft: '4%',
paddingRight: '4%',
display: 'flex',
flex: 1
flex: 1,
},
topContainer: {
flexGrow: 1,
display: 'flex',
justifyContent: 'center'
justifyContent: 'center',
},
bottomContainer: {
marginBottom: 30,
paddingTop: 30
paddingTop: 30,
},
title: {
marginBottom: 0
marginBottom: 0,
},
paragraph: {
...fontStyle,
marginLeft: 0,
marginRight: 0,
fontSize: normalize(16),
lineHeight: '1.3em',
fontWeight: '500'
fontWeight: '500',
},
buttonLayout: {
padding: normalize(5),
marginTop: normalize(20),
marginBottom: normalize(20)
marginBottom: normalize(20),
},
signInLink: {
...fontStyle,
textDecorationLine: 'underline',
fontSize: normalize(16)
fontSize: normalize(16),
},
acceptTermsText: {
...fontStyle,
fontSize: normalize(12)
fontSize: normalize(12),
},
acceptTermsLink: {
...fontStyle,
fontSize: normalize(12),
fontWeight: 'bold'
}
fontWeight: 'bold',
},
})

export default createStackNavigator(
{
Login: Auth,
TermsOfUse,
PrivacyPolicy,
Recover: Mnemonics
Recover: Mnemonics,
},
{
backRouteName: 'Auth'
backRouteName: 'Auth',
}
)
Loading

0 comments on commit c09f7f9

Please sign in to comment.