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 React from 'react'; | |
import { | |
Route as ReactDOMRoute, | |
RouteProps as ReactDOMRouteProps, | |
Redirect, | |
} from 'react-router-dom'; | |
import { useAuth } from '../hooks/auth'; |
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 'react-native-gesture-handler'; | |
import React from 'react'; | |
import { NavigationContainer } from '@react-navigation/native'; | |
import Routes from './routes'; | |
const App: React.FC = () => { | |
return ( | |
<NavigationContainer> | |
<Routes /> |
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 'react-native-gesture-handler'; | |
import React from 'react'; | |
import { TouchableOpacity } from 'react-native'; | |
import { NavigationContainer } from '@react-navigation/native'; | |
import { | |
createStackNavigator, | |
StackHeaderLeftButtonProps, | |
} from '@react-navigation/stack'; | |
import Icon from 'react-native-vector-icons/Feather'; |
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 function signInRequest(email, password) { | |
return { | |
type: '@auth/SIGN_IN_REQUEST', | |
payload: { email, password }, | |
}; | |
} | |
export function signInSuccess(token, user) { | |
return { | |
type: '@auth/SIGN_IN_SUCCESS', |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Container, Logo } from './styles'; | |
import logoImg from '../../../assets/images/logo.png'; | |
export default function AuthLayout({ style, children }) { | |
return ( | |
<Container> |
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 React, { | |
useEffect, | |
createContext, | |
useCallback, | |
useState, | |
useContext, | |
} from 'react'; | |
import AsyncStorage from '@react-native-community/async-storage'; | |
import api from '../services/api'; |
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
function deg2rad(deg) { | |
return deg * (Math.PI / 180); | |
} | |
export default function getDistanceFromLatLonInKm( | |
centerCoordinates, | |
pointCoordinates | |
) { | |
const radius = 6371; |
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 'react-native-gesture-handler'; | |
import React, { useEffect } from 'react'; | |
import { SafeAreaView, StatusBar } from 'react-native'; | |
import { NavigationContainer } from '@react-navigation/native'; | |
import SplashScreen from 'react-native-splash-screen'; | |
import AppProvider from './hooks'; | |
import Routes from './routes'; |
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 React, { | |
useState, | |
useCallback, | |
useEffect, | |
useRef, | |
useImperativeHandle, | |
forwardRef, | |
} from 'react'; | |
import { TextInputProps } from 'react-native'; | |
import { useField } from '@unform/core'; |
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 { MigrationInterface, QueryRunner, Table } from 'typeorm'; | |
export default class CreateUsersXCompanies1606436597898 | |
implements MigrationInterface { | |
public async up(queryRunner: QueryRunner): Promise<void> { | |
await queryRunner.createTable( | |
new Table({ | |
name: 'users_x_companies', | |
columns: [ | |
{ |